mirror of
https://github.com/ziglang/zig.git
synced 2026-01-31 03:33:37 +00:00
organize tests
This commit is contained in:
parent
6b2d06710c
commit
14422e0312
@ -1,8 +0,0 @@
|
||||
export fn disabledExternFn() {
|
||||
@setFnVisible(this, false);
|
||||
}
|
||||
|
||||
fn callDisabledExternFn() {
|
||||
@setFnTest(this);
|
||||
disabledExternFn();
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
// normal comment
|
||||
/// this is a documentation comment
|
||||
/// doc comment line 2
|
||||
fn emptyFunctionWithComments() {
|
||||
@setFnTest(this);
|
||||
}
|
||||
@ -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) {
|
||||
|
||||
@ -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();
|
||||
}
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user