@@ -77,42 +77,46 @@ def clear_complex():
77
77
python_result = clear_complex ()
78
78
assert python_result == pyccel_result
79
79
80
- def test_copy_int (python_only_language ):
80
+ def test_copy_int (language ):
81
81
def copy_int ():
82
82
se = {1 , 2 , 4 , 5 }
83
83
cop = se .copy ()
84
- return cop
85
- epyccel_copy = epyccel (copy_int , language = python_only_language )
84
+ size = len (cop )
85
+ a ,b ,c ,d = cop .pop (), cop .pop (), cop .pop (), cop .pop ()
86
+ return size , len (se ), a ,b ,c ,d
87
+ epyccel_copy = epyccel (copy_int , language = language )
86
88
pyccel_result = epyccel_copy ()
87
89
python_result = copy_int ()
88
90
assert isinstance (python_result , type (pyccel_result ))
89
- assert python_result == pyccel_result
90
- assert all (isinstance (elem , type (pyccel_result .pop ())) for elem in python_result )
91
+ assert python_result [0 ] == pyccel_result [0 ]
92
+ assert python_result [1 ] == pyccel_result [1 ]
93
+ assert set (python_result [2 :]) == set (pyccel_result [2 :])
91
94
92
95
93
- def test_copy_float (python_only_language ):
96
+ def test_copy_float (language ):
94
97
def copy_float ():
95
98
se = {5.7 , 6.2 , 4.3 , 9.8 }
96
99
cop = se .copy ()
97
- return cop
98
- epyccel_copy = epyccel (copy_float , language = python_only_language )
100
+ return len ( cop ), cop . pop (), cop . pop (), cop . pop (), cop . pop (), len ( se )
101
+ epyccel_copy = epyccel (copy_float , language = language )
99
102
pyccel_result = epyccel_copy ()
100
103
python_result = copy_float ()
101
104
assert isinstance (python_result , type (pyccel_result ))
102
- assert python_result == pyccel_result
103
- assert all (isinstance (elem , type (pyccel_result .pop ())) for elem in python_result )
105
+ assert python_result [0 ] == pyccel_result [0 ]
106
+ assert python_result [- 1 ] == pyccel_result [- 1 ]
107
+ assert set (python_result [1 :- 1 ]) == set (pyccel_result [1 :- 1 ])
104
108
105
- def test_copy_complex (python_only_language ):
109
+ def test_copy_complex (language ):
106
110
def copy_complex ():
107
111
se = {7j , 6j , 9j }
108
112
cop = se .copy ()
109
- return cop
110
- epyccel_copy = epyccel (copy_complex , language = python_only_language )
113
+ return len ( cop ), cop . pop (), cop . pop (), cop . pop ()
114
+ epyccel_copy = epyccel (copy_complex , language = language )
111
115
pyccel_result = epyccel_copy ()
112
116
python_result = copy_complex ()
113
117
assert isinstance (python_result , type (pyccel_result ))
114
- assert python_result == pyccel_result
115
- assert all ( isinstance ( elem , type ( pyccel_result . pop ())) for elem in python_result )
118
+ assert python_result [ 0 ] == pyccel_result [ 0 ]
119
+ assert set ( python_result [ 1 :]) == set ( pyccel_result [ 1 :] )
116
120
117
121
def test_remove_complex (python_only_language ):
118
122
def remove_complex ():
0 commit comments