Skip to content

Commit d8a4419

Browse files
illusory0x0bobzhang
authored andcommitted
passing correct loc
1 parent c9b3b51 commit d8a4419

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

builtin/assert.mbt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fn debug_string[T : Show](t : T) -> String {
4848
/// ```
4949
pub fn assert_eq[T : Eq + Show](a : T, b : T, loc~ : SourceLoc = _) -> Unit! {
5050
if a != b {
51-
fail!("`\{a} == \{b}`")
51+
fail!("`\{a} == \{b}`",loc~)
5252
}
5353
}
5454
@@ -86,7 +86,7 @@ pub fn assert_not_eq[T : Eq + Show](
8686
if not(a != b) {
8787
let a = debug_string(a)
8888
let b = debug_string(b)
89-
fail!("`\{a} != \{b}`")
89+
fail!("`\{a} != \{b}`",loc~)
9090
}
9191
}
9292
@@ -116,7 +116,7 @@ pub fn assert_not_eq[T : Eq + Show](
116116
/// ```
117117
pub fn assert_true(x : Bool, loc~ : SourceLoc = _) -> Unit! {
118118
if not(x) {
119-
fail!("`\{x}` is not true")
119+
fail!("`\{x}` is not true",loc~)
120120
}
121121
}
122122
@@ -148,6 +148,6 @@ pub fn assert_true(x : Bool, loc~ : SourceLoc = _) -> Unit! {
148148
pub fn assert_false(x : Bool, loc~ : SourceLoc = _) -> Unit! {
149149
if x {
150150
let x = debug_string(x)
151-
fail!("`\{x}` is not false")
151+
fail!("`\{x}` is not false",loc~)
152152
}
153153
}

0 commit comments

Comments
 (0)