Wiki
Show
Ignore:
Timestamp:
03/14/10 06:45:43 (2 years ago)
Author:
Chuck.Esterbrook
Message:

Arrays and lists can now be compared with == and <>.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • cobra/trunk/Tests/240-generics/100-use-generics-collections/100-use-list.cobra

    r1177 r2316  
    11class Test 
    22 
    3     def main is shared 
    4  
     3    def main 
     4        .testBasics 
     5        .compareWithArrays 
     6     
     7    def testBasics 
    58        t as List<of String> = List<of String>() 
    69        assert t.count == 0 
     
    2225#       assert v[0].equals('aoeu') 
    2326#       assert v[1].equals(1) 
     27 
     28    def compareWithArrays 
     29        a as int[] = @[1, 2, 3] 
     30        b as List<of int> = [1, 2, 3] 
     31        c as List<of int> = [1, 2, 3, 4] 
     32        assert a == b 
     33        assert b == a 
     34        assert a <> c 
     35        assert c <> a