diff options
| author | LemonBoy <thatlemon@gmail.com> | 2020-01-14 21:23:11 +0100 |
|---|---|---|
| committer | LemonBoy <thatlemon@gmail.com> | 2020-01-14 21:23:11 +0100 |
| commit | 49771f356fddda873405da2cc6aaffb2758abcbc (patch) | |
| tree | 80cb06256413e341d3cf813ded45d2dac91afb92 /test/compile_errors.zig | |
| parent | c1f3766f1c1a528ff24c24429298ff8ac162909f (diff) | |
| download | zig-49771f356fddda873405da2cc6aaffb2758abcbc.tar.gz zig-49771f356fddda873405da2cc6aaffb2758abcbc.zip | |
Make sure @export symbol name is not empty
Diffstat (limited to 'test/compile_errors.zig')
| -rw-r--r-- | test/compile_errors.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig index 6552ad2413..3ce5bd8801 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -2,6 +2,15 @@ const tests = @import("tests.zig"); const builtin = @import("builtin"); pub fn addCases(cases: *tests.CompileErrorContext) void { + cases.addTest("@export with empty name string", + \\pub export fn entry() void { } + \\comptime { + \\ @export(entry, .{ .name = "" }); + \\} + , &[_][]const u8{ + "tmp.zig:3:5: error: exported symbol name cannot be empty", + }); + cases.addTest("switch ranges endpoints are validated", \\pub export fn entry() void { \\ var x: i32 = 0; |
