fix test failure, organize code, add new compile error

This commit is contained in:
Andrew Kelley
2018-02-05 09:26:39 -05:00
parent ec59f76526
commit 44d8d654a0
12 changed files with 69 additions and 272 deletions

View File

@@ -1,6 +1,12 @@
const tests = @import("tests.zig");
pub fn addCases(cases: &tests.CompileErrorContext) void {
cases.add("cast negative integer literal to usize",
\\export fn entry() void {
\\ const x = usize(-10);
\\}
, ".tmp_source.zig:2:21: error: cannot cast negative value -10 to unsigned integer type 'usize'");
cases.add("use invalid number literal as array index",
\\var v = 25;
\\export fn entry() void {