authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-10-28 12:04:46-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-10-28 12:04:46-04:00
loge3857a361c528d23d1a9f727619c379bea1a3563
treec29a21d4e3ca1c80ec759a753df1a9d13d82f5ee
parentc982077156d362eec8844d2323b1d3b0bd7b2ce3

more test coverage


1 files changed, 12 insertions(+), 0 deletions(-)

test/run_tests.cpp+12
...@@ -1467,6 +1467,18 @@ fn function_with_return_type_type() {...@@ -1467,6 +1467,18 @@ fn function_with_return_type_type() {
1467 ".tmp_source.zig:4:5: note: unable to evaluate this expression at compile time",1467 ".tmp_source.zig:4:5: note: unable to evaluate this expression at compile time",
1468 ".tmp_source.zig:3:32: note: required to be compile-time function because of return type 'type'");1468 ".tmp_source.zig:3:32: note: required to be compile-time function because of return type 'type'");
14691469
1470 add_compile_fail_case("non pure function required to be pure", R"SOURCE(
1471var a: i32 = 0;
1472
1473fn foo() {
1474 @setFnStaticEval(this, true);
1475 a = 1;
1476}
1477 )SOURCE", 3,
1478 ".tmp_source.zig:4:1: error: failed to evaluate function at compile time",
1479 ".tmp_source.zig:6:5: note: unable to evaluate this expression at compile time",
1480 ".tmp_source.zig:5:5: note: required to be compile-time function here");
1481
1470 add_compile_fail_case("bogus method call on slice", R"SOURCE(1482 add_compile_fail_case("bogus method call on slice", R"SOURCE(
1471fn f(m: []const u8) {1483fn f(m: []const u8) {
1472 m.copy(u8, self.list.items[old_len...], m);1484 m.copy(u8, self.list.items[old_len...], m);