Skip to content

Commit 40ba378

Browse files
committed
new tests for the any variable type
1 parent 264ee7c commit 40ba378

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

OSL Programs/tests/unit/typed-variables.test.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,33 @@ const tests = [
125125
log value
126126
`,
127127
{ expect: [15] }
128-
)
128+
),
129+
130+
helper.createTest(
131+
'Any typed variable functions like local variables',
132+
`
133+
def arrSum(arr) (
134+
any out = 0
135+
for i arr.len (
136+
out += arr[i]
137+
)
138+
return out
139+
)
140+
141+
log arrsum([1,2,3,4,5])
142+
`,
143+
{ expect: [15] }
144+
),
145+
146+
helper.createTest(
147+
'Any typed variable does affect local variables',
148+
`
149+
any lol = 10
150+
local lol = 20
151+
log lol
152+
`,
153+
{ expect: [20] }
154+
),
129155
];
130156

131157
module.exports = { tests };

0 commit comments

Comments
 (0)