@@ -343,7 +343,22 @@ fn test_arithmetic_too_few_args() {
343
343
let module = make_module ( code) ;
344
344
let fun_context = get_fun_context ( & module) ;
345
345
let _result = type_safety:: verify ( & module, & fun_context, & mut DummyMeter ) ;
346
+ }
347
+ }
346
348
349
+ #[ test]
350
+ #[ should_panic]
351
+ fn test_arithmetic_no_args ( ) {
352
+ for instr in vec ! [
353
+ Bytecode :: Add ,
354
+ Bytecode :: Sub ,
355
+ Bytecode :: Mul ,
356
+ Bytecode :: Mod ,
357
+ Bytecode :: Div ,
358
+ Bytecode :: BitOr ,
359
+ Bytecode :: BitAnd ,
360
+ Bytecode :: Xor ,
361
+ ] {
347
362
let code = vec ! [ instr. clone( ) ] ;
348
363
let module = make_module ( code) ;
349
364
let fun_context = get_fun_context ( & module) ;
@@ -421,6 +436,16 @@ fn test_shl_shr_too_few_args() {
421
436
let fun_context = get_fun_context ( & module) ;
422
437
let _result = type_safety:: verify ( & module, & fun_context, & mut DummyMeter ) ;
423
438
439
+ }
440
+ }
441
+
442
+ #[ test]
443
+ #[ should_panic]
444
+ fn test_shl_shr_no_args ( ) {
445
+ for instr in vec ! [
446
+ Bytecode :: Shl ,
447
+ Bytecode :: Shr ,
448
+ ] {
424
449
let code = vec ! [ instr. clone( ) ] ;
425
450
let module = make_module ( code) ;
426
451
let fun_context = get_fun_context ( & module) ;
@@ -480,7 +505,16 @@ fn test_or_and_too_few_args() {
480
505
let module = make_module ( code) ;
481
506
let fun_context = get_fun_context ( & module) ;
482
507
let _result = type_safety:: verify ( & module, & fun_context, & mut DummyMeter ) ;
508
+ }
509
+ }
483
510
511
+ #[ test]
512
+ #[ should_panic]
513
+ fn test_or_and_no_args ( ) {
514
+ for instr in vec ! [
515
+ Bytecode :: Or ,
516
+ Bytecode :: And ,
517
+ ] {
484
518
let code = vec ! [ instr. clone( ) ] ;
485
519
let module = make_module ( code) ;
486
520
let fun_context = get_fun_context ( & module) ;
@@ -607,7 +641,18 @@ fn test_comparison_too_few_args() {
607
641
let module = make_module ( code) ;
608
642
let fun_context = get_fun_context ( & module) ;
609
643
let _result = type_safety:: verify ( & module, & fun_context, & mut DummyMeter ) ;
644
+ }
645
+ }
610
646
647
+ #[ test]
648
+ #[ should_panic]
649
+ fn test_comparison_no_args ( ) {
650
+ for instr in vec ! [
651
+ Bytecode :: Lt ,
652
+ Bytecode :: Gt ,
653
+ Bytecode :: Le ,
654
+ Bytecode :: Ge ,
655
+ ] {
611
656
let code = vec ! [ instr. clone( ) ] ;
612
657
let module = make_module ( code) ;
613
658
let fun_context = get_fun_context ( & module) ;
@@ -834,7 +879,16 @@ fn test_eq_neq_too_few_args() {
834
879
let module = make_module ( code) ;
835
880
let fun_context = get_fun_context ( & module) ;
836
881
let _result = type_safety:: verify ( & module, & fun_context, & mut DummyMeter ) ;
882
+ }
883
+ }
837
884
885
+ #[ test]
886
+ #[ should_panic]
887
+ fn test_eq_neq_no_args ( ) {
888
+ for instr in vec ! [
889
+ Bytecode :: Eq ,
890
+ Bytecode :: Neq ,
891
+ ] {
838
892
let code = vec ! [ instr. clone( ) ] ;
839
893
let module = make_module ( code) ;
840
894
let fun_context = get_fun_context ( & module) ;
0 commit comments