Commit 90ee507e authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fixed test-substrings

parent 1d21c272
/* CIF PROCESS (200, 143), (150, 75) */
PROCESS myfunction;
/* CIF TEXT (0, 133), (282, 128) */
/* CIF TEXT (7, 43), (334, 41) */
-- Test substrings in various contexts and operators
/* CIF ENDTEXT */
/* CIF TEXT (0, 133), (282, 136) */
dcl str MyOctStr := 'abc';
dcl variable_str String := 'Hello!';
......@@ -9,9 +12,6 @@ dcl seqof MySeqOf := {hello, world};
dcl seqint seqInt := {1};
dcl seqbool seqBool := { true, false};
dcl seqbool2 seqBool2 := { true, false};
/* CIF ENDTEXT */
/* CIF TEXT (7, 43), (327, 41) */
-- Test substrings in various contexts and operators
/* CIF ENDTEXT */
/* CIF PROCEDURE (1416, 490), (91, 35) */
PROCEDURE factorial;
......@@ -37,129 +37,131 @@ endfor;
/* CIF COMMENT (218, 326), (179, 53) */
COMMENT 'Check IN operator with
enumerated type';
/* CIF ANSWER (4, 395), (70, 23) */
/* CIF ANSWER (4, 395), (70, 24) */
(true):
/* CIF PROCEDURECALL (-49, 433), (177, 35) */
/* CIF PROCEDURECALL (-49, 434), (177, 35) */
CALL writeln(hello in seqof)
/* CIF COMMENT (148, 433), (111, 35) */
/* CIF COMMENT (148, 434), (114, 35) */
COMMENT 'print "TRUE"';
/* CIF ANSWER (269, 395), (70, 23) */
/* CIF ANSWER (268, 395), (70, 24) */
(false):
ENDDECISION;
/* CIF DECISION (59, 483), (155, 50) */
/* CIF DECISION (59, 484), (155, 50) */
DECISION hello in seqof(0,0)
/* CIF COMMENT (242, 466), (236, 53) */
/* CIF COMMENT (242, 462), (236, 56) */
COMMENT 'Check IN operator with
list substring - first element only
should go to branch TRUE';
/* CIF ANSWER (8, 526), (66, 33) */
/* CIF ANSWER (7, 522), (66, 33) */
(true):
/* CIF PROCEDURECALL (-59, 574), (201, 35) */
/* CIF PROCEDURECALL (-59, 570), (201, 35) */
CALL writeln(hello in seqof(0,1))
/* CIF COMMENT (162, 574), (111, 35) */
/* CIF COMMENT (162, 570), (114, 35) */
COMMENT 'print "TRUE"';
/* CIF ANSWER (286, 527), (70, 23) */
/* CIF ANSWER (285, 523), (70, 24) */
(false):
ENDDECISION;
/* CIF PROCEDURECALL (41, 624), (190, 35) */
/* CIF PROCEDURECALL (40, 620), (191, 35) */
CALL writeln(variable_str(0,4))
/* CIF COMMENT (243, 579), (113, 35) */
/* CIF COMMENT (243, 570), (113, 35) */
COMMENT 'print "Hello"';
/* CIF TASK (48, 674), (176, 53) */
/* CIF TASK (48, 670), (176, 56) */
TASK for x in seqof:
call writeln(num(x));
endfor
/* CIF COMMENT (242, 636), (96, 53) */
/* CIF COMMENT (242, 628), (96, 56) */
COMMENT 'print:
12
13';
/* CIF TASK (47, 742), (178, 53) */
/* CIF TASK (46, 741), (180, 56) */
TASK for x in seqof(0,1):
call writeln(-num(x));
endfor
/* CIF COMMENT (243, 697), (96, 53) */
/* CIF COMMENT (244, 692), (96, 56) */
COMMENT 'print:
-12
-13';
/* CIF PROCEDURECALL (46, 810), (180, 35) */
/* CIF PROCEDURECALL (46, 812), (180, 35) */
CALL writeln(length(seqof))
/* CIF COMMENT (246, 780), (77, 35) */
/* CIF COMMENT (246, 777), (77, 35) */
COMMENT 'print 2';
/* CIF PROCEDURECALL (32, 860), (209, 35) */
/* CIF PROCEDURECALL (32, 862), (209, 35) */
CALL writeln(length(seqof(0,1)))
/* CIF COMMENT (261, 830), (77, 35) */
/* CIF COMMENT (261, 827), (77, 35) */
COMMENT 'print 2';
/* CIF LABEL (55, 910), (162, 35) */
/* CIF LABEL (55, 912), (162, 35) */
variable_length_seq:
/* CIF TASK (65, 960), (142, 53) */
/* CIF TASK (65, 962), (142, 56) */
TASK for x in seqint:
call writeln(x);
endfor
/* CIF COMMENT (227, 915), (96, 53) */
/* CIF COMMENT (227, 913), (96, 53) */
COMMENT 'print:
1';
/* CIF TASK (61, 1028), (150, 53) */
/* CIF TASK (60, 1033), (152, 56) */
TASK for x in seqint(0,0):
call writeln(x);
endfor
/* CIF COMMENT (231, 983), (96, 53) */
/* CIF COMMENT (232, 984), (96, 53) */
COMMENT 'print:
1';
/* CIF DECISION (75, 1096), (123, 50) */
/* CIF DECISION (75, 1104), (123, 50) */
DECISION 1 in seqint
/* CIF COMMENT (217, 1056), (179, 53) */
/* CIF COMMENT (217, 1059), (179, 53) */
COMMENT 'Check IN operator with
variable-length seqOf';
/* CIF ANSWER (7, 1148), (66, 33) */
/* CIF ANSWER (6, 1151), (66, 33) */
(true):
/* CIF PROCEDURECALL (-48, 1196), (177, 35) */
/* CIF PROCEDURECALL (-48, 1199), (177, 35) */
CALL writeln(1 in seqint)
/* CIF COMMENT (149, 1196), (111, 35) */
/* CIF COMMENT (149, 1199), (114, 35) */
COMMENT 'print "TRUE"';
/* CIF ANSWER (267, 1148), (70, 23) */
/* CIF ANSWER (266, 1151), (70, 24) */
(false):
ENDDECISION;
/* CIF DECISION (73, 1246), (126, 50) */
/* CIF DECISION (72, 1249), (128, 50) */
DECISION 1 in seqint(0,0)
/* CIF COMMENT (218, 1206), (179, 53) */
/* CIF COMMENT (219, 1204), (179, 53) */
COMMENT 'Check IN operator with
variable-length seqOf';
/* CIF ANSWER (5, 1298), (70, 23) */
/* CIF ANSWER (5, 1296), (70, 24) */
(true):
/* CIF PROCEDURECALL (-49, 1336), (179, 35) */
/* CIF PROCEDURECALL (-51, 1335), (182, 35) */
CALL writeln(1 in seqint(0,0))
/* CIF COMMENT (150, 1336), (111, 35) */
/* CIF COMMENT (151, 1335), (114, 35) */
COMMENT 'print "TRUE"';
/* CIF ANSWER (268, 1298), (70, 23) */
/* CIF ANSWER (267, 1296), (70, 24) */
(false):
ENDDECISION;
/* CIF PROCEDURECALL (46, 1386), (180, 35) */
/* CIF PROCEDURECALL (46, 1385), (180, 35) */
CALL writeln(length(seqint))
/* CIF COMMENT (246, 1356), (77, 35) */
/* CIF COMMENT (246, 1350), (77, 35) */
COMMENT 'print 1';
/* CIF PROCEDURECALL (30, 1436), (212, 35) */
/* CIF PROCEDURECALL (30, 1435), (212, 35) */
CALL writeln(length(seqint(0,0)))
/* CIF COMMENT (262, 1406), (77, 35) */
/* CIF COMMENT (262, 1400), (77, 35) */
COMMENT 'print 1';
/* CIF TASK (56, 1486), (161, 35) */
/* CIF TASK (54, 1485), (163, 35) */
TASK seqint := seqint // {2};
/* CIF TASK (43, 1536), (186, 35) */
/* CIF TASK (41, 1535), (190, 35) */
TASK seqint := seqint(0,0) // {5};
/* CIF TASK (65, 1586), (142, 53) */
/* CIF TASK (65, 1585), (142, 56) */
TASK for x in seqint:
call writeln(x);
endfor
/* CIF COMMENT (229, 1565), (96, 53) */
/* CIF COMMENT (229, 1560), (96, 56) */
COMMENT 'print:
1
5';
/* CIF TASK (20, 1654), (233, 35) */
/* CIF TASK (20, 1656), (233, 35) */
TASK seqbool := seqbool and seqbool
/* CIF COMMENT (273, 1648), (193, 35) */
/* CIF COMMENT (273, 1645), (194, 35) */
COMMENT 'should not raise any error';
/* CIF TASK (10, 1704), (253, 38) */
TASK seqbool2 := seqbool2 and seqbool2;
/* CIF NEXTSTATE (104, 1757), (65, 33) */
/* CIF TASK (7, 1706), (258, 38) */
TASK 'seqbool2 := seqbool2 and seqbool2'
/* CIF COMMENT (285, 1707), (213, 35) */
COMMENT 'Variable-length -> raise error';
/* CIF NEXTSTATE (102, 1759), (68, 33) */
NEXTSTATE Wait;
/* CIF STATE (839, 313), (70, 35) */
STATE wait;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment