Examples of assertion failures comparing objects
This is a page with example snippets that raise AssertionFailure
when comparing various objects.
self assert: 'I am a string object' equals: 'I am another string object'
self assert: GtExampleComparisonExceptionWithDebuggingViews new expectedStringForTest equals: GtExampleComparisonExceptionWithDebuggingViews new computedStringForTest
self assert: #(1 2 3) equals: #(1 2 4)
self assert: #(#(1 2) #(1 2 3) #(1 2 #(3 4) )) equals: #(#(1 2) #(1 2 2 3) #(1 2 #(3 4 5) ))
self assert: #(7 1 2 3) asSet equals: #(1 7 2 4) asSet
self assert: {1 -> 'a'. 2 -> 'b'. 3 -> 'c'} asDictionary equals: {1 -> 'a'. 3 -> 'c'. 2 -> 'q'} asDictionary
self assert: Object new equals: Object new