rename some behavior tests
This commit is contained in:
parent
bc0a60c7a6
commit
4c78142af1
|
@ -8,7 +8,7 @@ fn testParamsAdd(a: i32, b: i32) -> i32 {
|
|||
}
|
||||
|
||||
|
||||
test "localVariables" {
|
||||
test "local variables" {
|
||||
testLocVars(2);
|
||||
}
|
||||
fn testLocVars(b: i32) {
|
||||
|
@ -17,7 +17,7 @@ fn testLocVars(b: i32) {
|
|||
}
|
||||
|
||||
|
||||
test "voidParameters" {
|
||||
test "void parameters" {
|
||||
voidFun(1, void{}, 2, {});
|
||||
}
|
||||
fn voidFun(a: i32, b: void, c: i32, d: void) {
|
||||
|
@ -28,7 +28,7 @@ fn voidFun(a: i32, b: void, c: i32, d: void) {
|
|||
}
|
||||
|
||||
|
||||
test "mutableLocalVariables" {
|
||||
test "mutable local variables" {
|
||||
var zero : i32 = 0;
|
||||
assert(zero == 0);
|
||||
|
||||
|
@ -39,7 +39,7 @@ test "mutableLocalVariables" {
|
|||
assert(i == 3);
|
||||
}
|
||||
|
||||
test "separateBlockScopes" {
|
||||
test "separate block scopes" {
|
||||
{
|
||||
const no_conflict : i32 = 5;
|
||||
assert(no_conflict == 5);
|
||||
|
@ -52,7 +52,7 @@ test "separateBlockScopes" {
|
|||
assert(c == 10);
|
||||
}
|
||||
|
||||
test "callFnWithEmptyString" {
|
||||
test "call function with empty string" {
|
||||
acceptsString("");
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ test "weird function name" {
|
|||
assert(@"weird function name"() == 1234);
|
||||
}
|
||||
|
||||
test "implicitCastFnUnreachableReturn" {
|
||||
test "implicit cast function unreachable return" {
|
||||
wantsFnWithVoid(fnWithUnreachable);
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ fn fnWithUnreachable() -> noreturn {
|
|||
}
|
||||
|
||||
|
||||
test "functionPointers" {
|
||||
test "function pointers" {
|
||||
const fns = []@typeOf(fn1) { fn1, fn2, fn3, fn4, };
|
||||
for (fns) |f, i| {
|
||||
assert(f() == u32(i) + 5);
|
||||
|
|
|
@ -2,7 +2,7 @@ const std = @import("std");
|
|||
const assert = std.debug.assert;
|
||||
const mem = std.mem;
|
||||
|
||||
test "continueInForLoop" {
|
||||
test "continue in for loop" {
|
||||
const array = []i32 {1, 2, 3, 4, 5};
|
||||
var sum : i32 = 0;
|
||||
for (array) |x| {
|
||||
|
@ -15,7 +15,7 @@ test "continueInForLoop" {
|
|||
if (sum != 6) unreachable
|
||||
}
|
||||
|
||||
test "forLoopWithPointerElemVar" {
|
||||
test "for loop with pointer elem var" {
|
||||
const source = "abcdefg";
|
||||
var target: [source.len]u8 = undefined;
|
||||
mem.copy(u8, target[0..], source);
|
||||
|
@ -28,7 +28,7 @@ fn mangleString(s: []u8) {
|
|||
}
|
||||
}
|
||||
|
||||
test "basicForLoop" {
|
||||
test "basic for loop" {
|
||||
const expected_result = []u8{9, 8, 7, 6, 0, 1, 2, 3, 9, 8, 7, 6, 0, 1, 2, 3 };
|
||||
|
||||
var buffer: [expected_result.len]u8 = undefined;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const assert = @import("std").debug.assert;
|
||||
|
||||
test "gotoAndLabels" {
|
||||
test "goto and labels" {
|
||||
gotoLoop();
|
||||
assert(goto_counter == 10);
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ var goto_counter: i32 = 0;
|
|||
|
||||
|
||||
|
||||
test "gotoLeaveDeferScope" {
|
||||
test "goto leave defer scope" {
|
||||
testGotoLeaveDeferScope(true);
|
||||
}
|
||||
fn testGotoLeaveDeferScope(b: bool) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const assert = @import("std").debug.assert;
|
||||
|
||||
test "ifStatements" {
|
||||
test "if statements" {
|
||||
shouldBeEqual(1, 1);
|
||||
firstEqlThird(2, 1, 2);
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ fn firstEqlThird(a: i32, b: i32, c: i32) {
|
|||
}
|
||||
|
||||
|
||||
test "elseIfExpression" {
|
||||
test "else if expression" {
|
||||
assert(elseIfExpressionF(1) == 1);
|
||||
}
|
||||
fn elseIfExpressionF(c: u8) -> u8 {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const assert = @import("std").debug.assert;
|
||||
const a_namespace = @import("import/a_namespace.zig");
|
||||
|
||||
test "callFnViaNamespaceLookup" {
|
||||
test "call fn via namespace lookup" {
|
||||
assert(a_namespace.foo() == 1234);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user