aboutsummaryrefslogtreecommitdiff
path: root/src/urm_test.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/urm_test.ml')
-rw-r--r--src/urm_test.ml168
1 files changed, 84 insertions, 84 deletions
diff --git a/src/urm_test.ml b/src/urm_test.ml
index f223bf6..bf620e0 100644
--- a/src/urm_test.ml
+++ b/src/urm_test.ml
@@ -14,33 +14,33 @@ let () =
14 ~title:"example_urm_add_program" 14 ~title:"example_urm_add_program"
15 (fun () -> 15 (fun () ->
16 let input_prgm = [ 16 let input_prgm = [
17 Zero 0; 17 URMZero 0;
18 Zero 3; 18 URMZero 3;
19 Jump (1, 3, 6); 19 URMJump (1, 3, 6);
20 Succ 0; 20 URMSucc 0;
21 Succ 3; 21 URMSucc 3;
22 Jump (3, 3, 2); 22 URMJump (3, 3, 2);
23 Zero 3; 23 URMZero 3;
24 Jump (2, 3, 11); 24 URMJump (2, 3, 11);
25 Succ 0; 25 URMSucc 0;
26 Succ 3; 26 URMSucc 3;
27 Jump (3, 3, 7)] 27 URMJump (3, 3, 7)]
28 and input_regs = [ 28 and input_regs = [
29 Reg (1, 2); 29 Reg (1, 2);
30 Reg (2, 3)] 30 Reg (2, 3)]
31 and expected_urm = { 31 and expected_urm = {
32 instptr = InstPtr ([], [ 32 instptr = InstPtr ([], [
33 (0, Zero 0); 33 (0, URMZero 0);
34 (1, Zero 3); 34 (1, URMZero 3);
35 (2, Jump (1, 3, 6)); 35 (2, URMJump (1, 3, 6));
36 (3, Succ 0); 36 (3, URMSucc 0);
37 (4, Succ 3); 37 (4, URMSucc 3);
38 (5, Jump (3, 3, 2)); 38 (5, URMJump (3, 3, 2));
39 (6, Zero 3); 39 (6, URMZero 3);
40 (7, Jump (2, 3, 11)); 40 (7, URMJump (2, 3, 11));
41 (8, Succ 0); 41 (8, URMSucc 0);
42 (9, Succ 3); 42 (9, URMSucc 3);
43 (10, Jump (3, 3, 7))]); 43 (10, URMJump (3, 3, 7))]);
44 regs = [ 44 regs = [
45 Reg (1, 2); 45 Reg (1, 2);
46 Reg (2, 3)]} 46 Reg (2, 3)]}
@@ -60,72 +60,72 @@ let () =
60 ~title:"example_urm_factorial_program" 60 ~title:"example_urm_factorial_program"
61 (fun () -> 61 (fun () ->
62 let input_prgm = [ 62 let input_prgm = [
63 Zero 4; 63 URMZero 4;
64 Jump (1, 4, 4); 64 URMJump (1, 4, 4);
65 Zero 8; 65 URMZero 8;
66 Jump (8, 8, 7); 66 URMJump (8, 8, 7);
67 Succ 1; 67 URMSucc 1;
68 Zero 9; 68 URMZero 9;
69 Jump (9, 9, 29); 69 URMJump (9, 9, 29);
70 Copy (2, 1); 70 URMCopy (2, 1);
71 Zero 1; 71 URMZero 1;
72 Succ 1; 72 URMSucc 1;
73 Zero 3; 73 URMZero 3;
74 Succ 3; 74 URMSucc 3;
75 Copy (5, 1); 75 URMCopy (5, 1);
76 Zero 1; 76 URMZero 1;
77 Zero 6; 77 URMZero 6;
78 Jump (3, 6, 25); 78 URMJump (3, 6, 25);
79 Zero 7; 79 URMZero 7;
80 Jump (5, 7, 22); 80 URMJump (5, 7, 22);
81 Succ 1; 81 URMSucc 1;
82 Succ 7; 82 URMSucc 7;
83 Zero 10; 83 URMZero 10;
84 Jump (10, 10, 17); 84 URMJump (10, 10, 17);
85 Succ 6; 85 URMSucc 6;
86 Zero 11; 86 URMZero 11;
87 Jump (11, 11, 15); 87 URMJump (11, 11, 15);
88 Jump (2, 3, 29); 88 URMJump (2, 3, 29);
89 Succ 3; 89 URMSucc 3;
90 Zero 12; 90 URMZero 12;
91 Jump (12, 12, 12); 91 URMJump (12, 12, 12);
92 Zero 13; 92 URMZero 13;
93 Jump (13, 13, 38)] 93 URMJump (13, 13, 38)]
94 and input_regs = [ 94 and input_regs = [
95 Reg (1, 5)] 95 Reg (1, 5)]
96 and expected_urm = { 96 and expected_urm = {
97 instptr = InstPtr ([], [ 97 instptr = InstPtr ([], [
98 (0, Zero 4); 98 (0, URMZero 4);
99 (1, Jump (1, 4, 4)); 99 (1, URMJump (1, 4, 4));
100 (2, Zero 8); 100 (2, URMZero 8);
101 (3, Jump (8, 8, 7)); 101 (3, URMJump (8, 8, 7));
102 (4, Succ 1); 102 (4, URMSucc 1);
103 (5, Zero 9); 103 (5, URMZero 9);
104 (6, Jump (9, 9, 29)); 104 (6, URMJump (9, 9, 29));
105 (7, Copy (2, 1)); 105 (7, URMCopy (2, 1));
106 (8, Zero 1); 106 (8, URMZero 1);
107 (9, Succ 1); 107 (9, URMSucc 1);
108 (10, Zero 3); 108 (10, URMZero 3);
109 (11, Succ 3); 109 (11, URMSucc 3);
110 (12, Copy (5, 1)); 110 (12, URMCopy (5, 1));
111 (13, Zero 1); 111 (13, URMZero 1);
112 (14, Zero 6); 112 (14, URMZero 6);
113 (15, Jump (3, 6, 25)); 113 (15, URMJump (3, 6, 25));
114 (16, Zero 7); 114 (16, URMZero 7);
115 (17, Jump (5, 7, 22)); 115 (17, URMJump (5, 7, 22));
116 (18, Succ 1); 116 (18, URMSucc 1);
117 (19, Succ 7); 117 (19, URMSucc 7);
118 (20, Zero 10); 118 (20, URMZero 10);
119 (21, Jump (10, 10, 17)); 119 (21, URMJump (10, 10, 17));
120 (22, Succ 6); 120 (22, URMSucc 6);
121 (23, Zero 11); 121 (23, URMZero 11);
122 (24, Jump (11, 11, 15)); 122 (24, URMJump (11, 11, 15));
123 (25, Jump (2, 3, 29)); 123 (25, URMJump (2, 3, 29));
124 (26, Succ 3); 124 (26, URMSucc 3);
125 (27, Zero 12); 125 (27, URMZero 12);
126 (28, Jump (12, 12, 12)); 126 (28, URMJump (12, 12, 12));
127 (29, Zero 13); 127 (29, URMZero 13);
128 (30, Jump (13, 13, 38))]); 128 (30, URMJump (13, 13, 38))]);
129 regs = [ 129 regs = [
130 Reg (1, 5)]} 130 Reg (1, 5)]}
131 and expected_output = [ 131 and expected_output = [