pike.git/
src/
testsuite.in
Branch:
Tag:
Non-build tags
All tags
No tags
2022-12-22
2022-12-22 12:01:38 by Henrik Grubbström (Grubba) <grubba@grubba.org>
4b71d1d4b086badcfe5b6d7fdc38eca70f7269e8 (
33
lines) (+
33
/-
0
)
[
Show
|
Annotate
]
Branch:
master
Testsuite: Added some tests of multi-assign in function calls.
Tests
#10098
.
897:
18, 18, 34, 0, 37, 35 }))
+
dnl Multi-assign in function calls.
+
test_any([[
+
// Lifted from issue #10098.
+
int add([int a, int b], int c) { return a + b + c; }
+
return add(({ 1, 2 }), 3);
+
]], 6)
+
test_equal([[
+
lambda(int a, [int b, int c, [int e, int f]], int d){
+
return ({ a, b, c, d, e, f });
+
}(1, ({ 3, 4, ({ 5, 6 }) }), 7);
+
]], ({ 1, 3, 4, 7, 5, 6 }))
+
test_equal([[
+
lambda(int a, [int b, int c], int d){
+
return ({ a, b, c, d });
+
}(1, ({ 2, 3 }), 4);
+
]], ({ 1, 2, 3, 4 }))
+
test_equal([[
+
lambda(int a, [int b, int c] = ({ 5, 6 }), int d = 10){
+
return ({ a, b, c, d });
+
}(1, ({ 2, 3 }), 4);
+
]], ({ 1, 2, 3, 4 }))
+
test_equal([[
+
lambda(int a, [int b, int c] = ({ 5, 6 }), int d = 10){
+
return ({ a, b, c, d });
+
}(1, ({ 2, 3 }));
+
]], ({ 1, 2, 3, 10 }))
+
test_equal([[
+
lambda(int a, [int b, int c] = ({ 5, 6 }), int d = 10){
+
return ({ a, b, c, d });
+
}(1);
+
]], ({ 1, 5, 6, 10 }))
+
dnl bug in for loop optimization in combination with += test_any([[ array v=({1,2,3});