@@ -188,17 +188,22 @@ def compare_list(l1, l2, wil=False):
188
188
execution_tests = [
189
189
([('push' , 1 )], ([1 ], {}, {}, {}), 'push' ),
190
190
([('push' , 1 ), 'dup' ], ([1 , 1 ], {}, {}, {}), 'dup' ),
191
- ([('push' , 2 ), 'dup' , 'add' ], ([4 ], {}, {}, {}), 'add' ),
192
- ([('label' , 0 )], ([], {}, {0 : 1 }, {}), 'label 0' ),
193
191
([('push' , 1 ), ('push' , 2 ), ('copy' , 1 )], ([1 , 2 , 1 ], {}, {}, {}), 'copy' ),
194
192
([('push' , 1 ), ('push' , 2 ), 'swap' ], ([2 , 1 ], {}, {}, {}), 'swap' ),
195
193
([('push' , 10 ), 'pop' ], ([], {}, {}, {}), 'pop' ),
194
+ ([('push' , 1 ), ('push' , 2 ), ('push' , 3 ), ('slide' , 2 )], ([3 ], {}, {}, {}), 'slide' ),
195
+ ([('push' , 2 ), 'dup' , 'add' ], ([4 ], {}, {}, {}), 'add' ),
196
196
([('push' , 3 ), 'dup' , 'sub' ], ([0 ], {}, {}, {}), 'sub' ),
197
- ([('push' , 1 ), ('push' , 2 ), ('push' , 3 ), ('slide' , 2 )], ([3 ], {}, {}, {}), 'slide' )
197
+ ([('push' , 3 ), 'dup' , 'mul' ], ([9 ], {}, {}, {}), 'mul' ),
198
+ ([('push' , 5 ), ('push' , 2 ), 'div' ], ([2 ], {}, {}, {}), 'div' ),
199
+ ([('push' , 5 ), ('push' , 2 ), 'mod' ], ([1 ], {}, {}, {}), 'mod' ),
200
+ ([('push' , 'ad1' ), ('push' , 2 ), 'store' ], ([], {'ad1' : 2 }, {}, {}), 'store' ),
201
+ ([('push' , 'ad1' ), ('push' , 2 ), 'store' , ('push' , 'ad1' ), 'retri' ], ([2 ], {'ad1' : 2 }, {}, {}), 'retrieve' ),
202
+ ([('label' , 0 )], ([], {}, {0 : 1 }, {}), 'label 0' ),
198
203
]
199
204
for t in execution_tests :
200
205
restore_context ()
201
206
if perform_test (t ):
202
207
print ('[{}OK{}] {}' .format (bcolors .OKGREEN , bcolors .ENDC , t [2 ]))
203
208
else :
204
- print ('[{}KO{}] {}, got: ({} {} {} {}), expected: {}' .format (bcolors .FAIL , bcolors .ENDC , t [2 ], Stack , Heap , Labels , Routines , t [1 ]))
209
+ print ('[{}KO{}] {}, got: ({} {} {} {}), expected: {}' .format (bcolors .FAIL , bcolors .ENDC , t [2 ], ex . Stack , ex . Heap , ex . Labels , ex . Routines , t [1 ]))
0 commit comments