File tree Expand file tree Collapse file tree 9 files changed +72
-56
lines changed Expand file tree Collapse file tree 9 files changed +72
-56
lines changed File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ use QAST ;
2
+
3
+ plan (5 );
4
+
5
+ # Following a test infrastructure.
6
+ sub compile_qast ($ qast ) {
7
+ my $ * QAST_BLOCK_NO_CLOSE := 1 ;
8
+ nqp ::getcomp(' nqp' ). compile($ qast , : from(' ast' ));
9
+ }
10
+ sub is_qast ($ qast , $ value , $ desc ) {
11
+ try {
12
+ my $ code := compile_qast($ qast );
13
+ ok ($ code () eq $ value , $ desc );
14
+ CATCH { ok (0 , $ desc ) }
15
+ }
16
+ }
17
+
18
+ is_qast(
19
+ QAST ::Block. new (
20
+ QAST ::VM. new (
21
+ parrot => QAST ::IVal. new ( : value(42 ) ),
22
+ unknown => QAST ::IVal. new ( : value(69 ) )
23
+ )
24
+ ),
25
+ 42 ,
26
+ ' QAST::VM picks parrot alternative and ignores others' );
27
+
28
+ is_qast(
29
+ QAST ::Block. new (
30
+ QAST ::VM. new (
31
+ pir => " .return ('Leffe')" ,
32
+ ),
33
+ QAST ::SVal. new ( : value(' Fosters' ) )
34
+ ),
35
+ ' Leffe' ,
36
+ ' QAST::VM with pir works' );
37
+
38
+ is_qast(
39
+ QAST ::Block. new (
40
+ QAST ::VM. new (
41
+ pir => " % r = box 'set'" ,
42
+ )
43
+ ),
44
+ ' set' ,
45
+ ' QAST::VM with pir and %r works' );
46
+
47
+ is_qast(
48
+ QAST ::Block. new (
49
+ QAST ::VM. new (
50
+ pirop => ' add__Iii' ,
51
+ QAST ::IVal. new ( : value(15 ) ),
52
+ QAST ::IVal. new ( : value(10 ) )
53
+ )
54
+ ),
55
+ 25 ,
56
+ ' QAST::VM with pirop and signature after __' );
57
+
58
+ is_qast(
59
+ QAST ::Block. new (
60
+ QAST ::VM. new (
61
+ pirop => ' add Iii' ,
62
+ QAST ::IVal. new ( : value(15 ) ),
63
+ QAST ::IVal. new ( : value(100 ) )
64
+ )
65
+ ),
66
+ 115 ,
67
+ ' QAST::VM with pirop and signature after a space' );
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 1
1
use QAST ;
2
2
3
- plan (73 );
3
+ plan (68 );
4
4
5
5
# Following a test infrastructure.
6
6
sub compile_qast ($ qast ) {
@@ -919,57 +919,6 @@ test_qast_result(
919
919
ok (SCTest. main, ' mainline OK' );
920
920
});
921
921
922
- is_qast(
923
- QAST ::Block. new (
924
- QAST ::VM. new (
925
- parrot => QAST ::IVal. new ( : value(42 ) ),
926
- unknown => QAST ::IVal. new ( : value(69 ) )
927
- )
928
- ),
929
- 42 ,
930
- ' QAST::VM picks parrot alternative and ignores others' );
931
-
932
- is_qast(
933
- QAST ::Block. new (
934
- QAST ::VM. new (
935
- pir => " .return ('Leffe')" ,
936
- ),
937
- QAST ::SVal. new ( : value(' Fosters' ) )
938
- ),
939
- ' Leffe' ,
940
- ' QAST::VM with pir works' );
941
-
942
- is_qast(
943
- QAST ::Block. new (
944
- QAST ::VM. new (
945
- pir => " % r = box 'set'" ,
946
- )
947
- ),
948
- ' set' ,
949
- ' QAST::VM with pir and %r works' );
950
-
951
- is_qast(
952
- QAST ::Block. new (
953
- QAST ::VM. new (
954
- pirop => ' add__Iii' ,
955
- QAST ::IVal. new ( : value(15 ) ),
956
- QAST ::IVal. new ( : value(10 ) )
957
- )
958
- ),
959
- 25 ,
960
- ' QAST::VM with pirop and signature after __' );
961
-
962
- is_qast(
963
- QAST ::Block. new (
964
- QAST ::VM. new (
965
- pirop => ' add Iii' ,
966
- QAST ::IVal. new ( : value(15 ) ),
967
- QAST ::IVal. new ( : value(100 ) )
968
- )
969
- ),
970
- 115 ,
971
- ' QAST::VM with pirop and signature after a space' );
972
-
973
922
is_qast(
974
923
QAST ::Block. new (
975
924
QAST ::Stmts. new (
Original file line number Diff line number Diff line change @@ -1095,16 +1095,16 @@ bootstrap-files: $(STAGE2_PBCS) src/stage2/$(CORE_SETTING_NQP)
1095
1095
# # testing
1096
1096
1097
1097
test : all
1098
- prove -r --exec ./$(NQP_EXE ) t/nqp t/hll t/qregex t/p5regex t/qast t/serialization
1098
+ prove -r --exec ./$(NQP_EXE ) t/nqp t/parrot t/ hll t/qregex t/p5regex t/qast t/serialization
1099
1099
1100
1100
test-loud : all
1101
- prove -r -v --exec ./$(NQP_EXE ) t/nqp t/hll t/qregex t/p5regex t/qast t/serialization
1101
+ prove -r -v --exec ./$(NQP_EXE ) t/nqp t/parrot t/ hll t/qregex t/p5regex t/qast t/serialization
1102
1102
1103
1103
core-test : $(NQP_EXE )
1104
- prove -r --exec ./$(NQP_EXE ) t/nqp
1104
+ prove -r --exec ./$(NQP_EXE ) t/nqp t/parrot
1105
1105
1106
1106
core-test-loud : $(NQP_EXE )
1107
- prove -r -v --exec ./$(NQP_EXE ) t/nqp
1107
+ prove -r -v --exec ./$(NQP_EXE ) t/nqp t/parrot
1108
1108
1109
1109
qregex-test : $(NQP_EXE )
1110
1110
prove -r --exec ./$(NQP_EXE ) t/qregex
You can’t perform that action at this time.
0 commit comments