Mariano Martinez Peck wrote: > > Hi: I want to include this tests in next PharoDev as I did with the rest > of > the projects. > > The problem is known problem with MC and packages. If I load the packages > from > > http://www.squeaksource.com/RBBugFixes > > It has the packages: > > Refactoring-Spelling-BugFixes > Refactoring-Tests-Spelling > > The first one is interpreted as a part of the package Refactoring-Spelling > and the second one as Refactoring-Tests > Thus, those packages are "dirty" in compare to the repository: > http://www.squeaksource.com/rb > > This is really problematic. A quick solution is to rename both packages to > something like this: > > BugFixes-Refactoring-Spelling > Refactoring-SpellingTests > > Any other has a better solution? > > Thanks > > Mariano > > On Tue, Jan 12, 2010 at 5:14 PM, Stan Shepherd > <[email protected]>wrote: > >> >> >> Lukas Renggli wrote: >> > >> > Hi Stan, >> > >> >> Some are failing, as there are $' characters being passed through from >> >> the >> >> parser. Also, the literals check sees to be checking the node, rather >> >> than >> >> the node value. >> > >> > You are right, the code that extracted arguments and temps >> > unnecessarily put the names into $' characters. This is totally wrong >> > and also breaks the highlighting in the browser. Instead of changing >> > the tokenizer (as you proposed) I fixed the places where the nodes >> > were collected. Like this there should be no more $' characters in the >> > strings that are checked. >> > >> > Name: Refactoring-Spelling-lr.10 >> > Author: lr >> > Time: 12 January 2010, 12:16:16 am >> > UUID: b40774a4-8371-42f4-883c-469d6fe1e020 >> > Ancestors: Refactoring-Spelling-lr.9 >> > >> > - fixed the bug pointed out by Stan Shepherd that temps and arguments >> > were not properly checked >> > - this also fixes the issue of not highlighting typos in temps and >> > arguments (which I looked into earlier today, but couldn't figure out >> > the real cause) >> > >> >> There are some suggested changes in the same repository, that make the >> >> tests >> >> run green, and don't appear to affect the rest of Refactoring-Tests. >> > >> > The tests are really cool. I would like to add them to the main >> > repository, but two are broken depending on what checker is used: >> > >> > RBMacSpellChecker: #testLiteralValues and #testPoolVariable >> > RBInternalSpellChecker: #testLiteralValues and #testClassComments >> > >> > Maybe that could be fixed by always using the internal one for the >> > tests, but then I don't understand why the tests break. Does my fix >> > not solve the whole problem? >> > >> > Lukas >> > >> >> Hi, there are still $' present. Don't know if it's possible to strip them >> out earlier again. >> >> The following methods again strip leading and trailing '. They validate >> correctly, including 'don''t'. >> They are in Squeaksource RBBugFixes. So is a new version of the tests, >> that >> test spelling of 'don''t'. It also checks all the tests are run- one got >> lost in transcription last time. >> >> Also, the name of the Pool Dictionary test got reverted. >> >> ...Stan >> >> >> >> >> RBSpellChecker>>normalize: aString >> "Filter out non alphabetical characters, remove prefixes as >> commonly >> found >> in class names, split camel case expressions and filter out one character >> words." >> >> | result input output activeString | >> result := Set new. >> input := aString readStream. >> output := WriteStream on: (String new: 128). >> [ input atEnd ] whileFalse: [ >> [ input atEnd not and: [ input peek isLetter or: [ input >> peek = $' ] ] ] >> whileTrue: [ output nextPut: input next ]. >> output position = 0 >> ifTrue: [ input next ] >> ifFalse: [ >> | stream | >> stream := output contents readStream. >> [ stream atEnd ] whileFalse: [ >> output reset; nextPut: stream >> next. >> [ stream atEnd not and: [ stream >> peek isLowercase or: [ stream peek = >> $' ] ] ] >> whileTrue: [ output >> nextPut: >> stream next ]. >> >> "at this point we have allowed >> through $' to allow don't. We can also >> have leading or trailing $', >> if a comment contains eg 'WB' or >> 'NASA' " >> activeString := self >> copyWithoutLeadingTrailingSingleQuotes: output >> contents . >> activeString size > 1 >> ifTrue: [ result add: >> activeString ] ] ]. >> output reset ]. >> ^ result >> >> >> RBSpellChecker>>copyWithoutLeadingTrailingSingleQuotes: aByteString >> | startPosition endPosition | >> startPosition := 1. >> [ (aByteString at: startPosition) = $' ] >> whileTrue: >> [ startPosition := startPosition + 1. >> startPosition > aByteString size >> ifTrue: [ ^ '' ] ]. >> endPosition := aByteString size. >> [ (aByteString at: endPosition) = $' ] >> whileTrue: >> [ endPosition := endPosition - 1. >> endPosition < 1 >> ifTrue: [ ^ '' ] ]. >> ^ aByteString copyFrom: startPosition to: endPosition >> >
Hi Mariano, probably best to wait til the tests are in the main rb repository. At the moment they would fail, as there is still a discrepancy with what comes through from the parser. ...Stan -- View this message in context: http://n2.nabble.com/Spell-check-test-cases-tp4288633p4406315.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com. _______________________________________________ Pharo-project mailing list [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
