organize tests

This commit is contained in:
Andrew Kelley 2016-12-19 00:53:18 -05:00
parent 6b2d06710c
commit 14422e0312
6 changed files with 27 additions and 33 deletions

View File

@ -1,8 +0,0 @@
export fn disabledExternFn() {
@setFnVisible(this, false);
}
fn callDisabledExternFn() {
@setFnTest(this);
disabledExternFn();
}

View File

@ -1,6 +0,0 @@
// normal comment
/// this is a documentation comment
/// doc comment line 2
fn emptyFunctionWithComments() {
@setFnTest(this);
}

View File

@ -40,6 +40,16 @@ fn fnWithInlineArgs() {
assert(sameButWithFloats(0.43, 0.49) == 0.49);
}
fn inlinedLoop() {
@setFnTest(this);
inline var i = 0;
inline var sum = 0;
inline while (i <= 5; i += 1)
sum += i;
assert(sum == 15);
}
// TODO const assert = @import("std").debug.assert;
fn assert(ok: bool) {

View File

@ -1,16 +0,0 @@
fn inlinedLoop() {
@setFnTest(this);
inline var i = 0;
inline var sum = 0;
inline while (i <= 5; i += 1)
sum += i;
assert(sum == 15);
}
// TODO const assert = @import("std").debug.assert;
fn assert(ok: bool) {
if (!ok)
@unreachable();
}

View File

@ -1,3 +1,20 @@
// normal comment
/// this is a documentation comment
/// doc comment line 2
fn emptyFunctionWithComments() {
@setFnTest(this);
}
export fn disabledExternFn() {
@setFnVisible(this, false);
}
fn callDisabledExternFn() {
@setFnTest(this);
disabledExternFn();
}
fn intTypeBuiltin() {
@setFnTest(this);

View File

@ -1,7 +1,4 @@
// TODO '_' identifier for unused variable bindings
const test_empty_fn_with_comments = @import("cases3/empty_fn_with_comments.zig");
const test_disabled_export = @import("cases3/disabled_export.zig");
const test_inlined_loop = @import("cases3/inlined_loop.zig");
const test_misc = @import("cases3/misc.zig");
const test_switch = @import("cases3/switch.zig");
const test_error = @import("cases3/error.zig");