diff options
Diffstat (limited to 'doc/tutorial.md')
| -rw-r--r-- | doc/tutorial.md | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/tutorial.md b/doc/tutorial.md index b1eceeab70e..79553d5aa6e 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -381,7 +381,7 @@ expression to the given type. ~~~~ let x: float = 4.0; let y: uint = x as uint; -assert y == 4u; +fail_unless!(y == 4u); ~~~~ ## Syntax extensions @@ -849,8 +849,8 @@ Ending the function with a semicolon like so is equivalent to returning `()`. fn line(a: int, b: int, x: int) -> int { a * x + b } fn oops(a: int, b: int, x: int) -> () { a * x + b; } -assert 8 == line(5, 3, 1); -assert () == oops(5, 3, 1); +fail_unless!(8 == line(5, 3, 1)); +fail_unless!(() == oops(5, 3, 1)); ~~~~ As with `match` expressions and `let` bindings, function arguments support @@ -1000,7 +1000,7 @@ let x = ~10; let y = copy x; let z = *x + *y; -assert z == 20; +fail_unless!(z == 20); ~~~~ When they do not contain any managed boxes, owned boxes can be sent @@ -1327,8 +1327,8 @@ and [`core::str`]. Here are some examples. let crayons = [Almond, AntiqueBrass, Apricot]; // Check the length of the vector -assert crayons.len() == 3; -assert !crayons.is_empty(); +fail_unless!(crayons.len() == 3); +fail_unless!(!crayons.is_empty()); // Iterate over a vector, obtaining a pointer to each element for crayons.each |crayon| { |
