aboutsummaryrefslogtreecommitdiff
path: root/test/cases/while.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-06-14 18:27:59 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-06-14 18:27:59 -0400
commit32dd98b19fe3cc384df32704dac0ff3e377dbe0c (patch)
tree2eddf3618d80313bdd24c25bd589bd474f3d82fc /test/cases/while.zig
parentef7f69d14a017c6c2065e4a376bb8e1f05ace04b (diff)
parentf0697c28f80d64c544302aea576e41ebc443b41c (diff)
downloadzig-32dd98b19fe3cc384df32704dac0ff3e377dbe0c.tar.gz
zig-32dd98b19fe3cc384df32704dac0ff3e377dbe0c.zip
Merge remote-tracking branch 'origin/master' into llvm7
Diffstat (limited to 'test/cases/while.zig')
-rw-r--r--test/cases/while.zig12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/cases/while.zig b/test/cases/while.zig
index a95481668d..fe53522ea6 100644
--- a/test/cases/while.zig
+++ b/test/cases/while.zig
@@ -81,7 +81,7 @@ test "while with else" {
assert(got_else == 1);
}
-test "while with nullable as condition" {
+test "while with optional as condition" {
numbers_left = 10;
var sum: i32 = 0;
while (getNumberOrNull()) |value| {
@@ -90,7 +90,7 @@ test "while with nullable as condition" {
assert(sum == 45);
}
-test "while with nullable as condition with else" {
+test "while with optional as condition with else" {
numbers_left = 10;
var sum: i32 = 0;
var got_else: i32 = 0;
@@ -132,7 +132,7 @@ fn getNumberOrNull() ?i32 {
};
}
-test "while on nullable with else result follow else prong" {
+test "while on optional with else result follow else prong" {
const result = while (returnNull()) |value| {
break value;
} else
@@ -140,8 +140,8 @@ test "while on nullable with else result follow else prong" {
assert(result == 2);
}
-test "while on nullable with else result follow break prong" {
- const result = while (returnMaybe(10)) |value| {
+test "while on optional with else result follow break prong" {
+ const result = while (returnOptional(10)) |value| {
break value;
} else
i32(2);
@@ -210,7 +210,7 @@ fn testContinueOuter() void {
fn returnNull() ?i32 {
return null;
}
-fn returnMaybe(x: i32) ?i32 {
+fn returnOptional(x: i32) ?i32 {
return x;
}
fn returnError() error!i32 {