Marcel Taeumel uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-mt.231.mcz ==================== Summary ==================== Name: CollectionsTests-mt.231 Author: mt Time: 16 January 2015, 10:57:00.276 am UUID: 92893f87-f9a7-be46-874a-7353a3f29614 Ancestors: CollectionsTests-topa.230 More tests for OrderedDictionary =============== Diff against CollectionsTests-topa.230 =============== Item was added: + ----- Method: OrderedDictionaryTest>>testAtIndex (in category 'tests - accessing') ----- + testAtIndex + + 1 to: 10 do: [:ea | + sut at: ea put: nil]. + + 1 to: 10 do: [:index | + self assert: index equals: (sut atIndex: index) key].! Item was added: + ----- Method: OrderedDictionaryTest>>testCopy (in category 'tests - copying') ----- + testCopy + + sut + at: 1 put: nil; + at: 2 put: nil; + at: 1 put: nil. + + sut copy in: [:copy | + self assert: sut keys equals: copy keys. + copy at: 2 put: nil. + self + assert: sut keys size = copy keys size; + assert: sut keys ~= copy keys].! Item was added: + ----- Method: OrderedDictionaryTest>>testFirst (in category 'tests - accessing') ----- + testFirst + + 1 to: 10 do: [:ea | + sut at: ea put: nil]. + + #(first second third fourth fifth sixth seventh eighth ninth) withIndexDo: [:selector :index | + self assert: index equals: (sut perform: selector) key].! Item was added: + ----- Method: OrderedDictionaryTest>>testIsSorted (in category 'tests - sorting') ----- + testIsSorted + + 10 to: 1 by: -1 do: [:ea | + sut at: ea put: nil]. + + self assert: sut isSorted not. + sut sort. + self assert: sut isSorted.! Item was added: + ----- Method: OrderedDictionaryTest>>testSort (in category 'tests - sorting') ----- + testSort + + 10 to: 1 by: -1 do: [:ea | + sut at: ea put: nil]. + + self assert: (10 to: 1 by: -1) asArray equals: sut keys. + sut sort. + self assert: (1 to: 10) asArray equals: sut keys.! Item was added: + ----- Method: OrderedDictionaryTest>>testSortAfterOverwrite (in category 'tests - sorting') ----- + testSortAfterOverwrite + + 10 to: 1 by: -1 do: [:ea | + sut at: ea put: nil]. + + sut at: 5 put: nil. + sut sort. + self assert: (1 to: 10) asArray equals: sut keys.! Item was added: + ----- Method: OrderedDictionaryTest>>testSortCustom (in category 'tests - sorting') ----- + testSortCustom + + | values | + values := #(The quick brown fox jumps over the lazy dog). + 1 to: 9 do: [:ea | + sut at: ea put: (values at: ea)]. + sut sort: [:a1 :a2 | a1 value <= a2 value]. + self assert: values sorted equals: sut values. + ! Item was added: + ----- Method: OrderedDictionaryTest>>testSorted (in category 'tests - sorting') ----- + testSorted + + 10 to: 1 by: -1 do: [:ea | + sut at: ea put: nil]. + + sut sorted in: [:copy | + self + assert: copy ~~ sut; + assert: copy keys = sut keys reversed].! |
Free forum by Nabble | Edit this page |