Skip to content

Commit c6a7147

Browse files
committed
Removed DINT return from Progs, fixed a typo, added a test case
1 parent f91c8df commit c6a7147

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/correctness/constants.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fn constant_values_used_as_initial_values() {
2525
gF : LREAL := cF;
2626
END_VAR
2727
28-
PROGRAM main : DINT
28+
PROGRAM main
2929
VAR
3030
i : DINT;
3131
b : BOOL;
@@ -67,17 +67,17 @@ fn constant_expressions_used_as_initial_values() {
6767
let src = r#"
6868
VAR_GLOBAL CONSTANT
6969
cI : DINT := 2 * 5;
70-
cB : BOOL := (CI-5 = 5);
70+
cB : BOOL := (cI-5 = 5);
7171
cF : LREAL := 2.1543 + cI;
7272
END_VAR
7373
7474
VAR_GLOBAL CONSTANT
7575
gI : DINT := cI;
7676
gb : BOOL := cB;
77-
gF : LREAL := cF;
77+
gF : LREAL := cF + gI * 2;
7878
END_VAR
7979
80-
PROGRAM main : DINT
80+
PROGRAM main
8181
VAR
8282
i : DINT;
8383
b : BOOL;
@@ -99,7 +99,7 @@ fn constant_expressions_used_as_initial_values() {
9999
MainType {
100100
i: 10,
101101
b: true,
102-
f: 12.1543,
102+
f: 32.1543,
103103
},
104104
);
105105
}
@@ -123,7 +123,7 @@ fn constant_expressions_used_in_case_statement() {
123123
number_3 : DINT := 8;
124124
END_VAR
125125
126-
PROGRAM main : DINT
126+
PROGRAM main
127127
VAR
128128
i : DINT;
129129
b : BOOL;
@@ -193,7 +193,7 @@ fn constant_expressions_used_in_array_declaration() {
193193
THREE : DINT := 3;
194194
END_VAR
195195
196-
PROGRAM main : DINT
196+
PROGRAM main
197197
VAR
198198
i : ARRAY[ 1 .. (TWO + THREE) * TWO] OF DINT; // 1 .. 10
199199
j : DINT;

0 commit comments

Comments
 (0)