diff --git a/test/anchor_dump.mojo b/test/anchor_dump.mojo index cceb6fb..68a5a70 100644 --- a/test/anchor_dump.mojo +++ b/test/anchor_dump.mojo @@ -15,7 +15,8 @@ from xml import fromstring, Element def _esc(s_in: String, strip: Bool) -> String: var s = s_in if strip: - s = String(s.strip()) + var stripped = String(s.strip()) + s = stripped^ # order matters: backslash first var out = String() for ch in s.codepoint_slices(): diff --git a/test/test_errors.mojo b/test/test_errors.mojo index 92ebbd2..833d65f 100644 --- a/test/test_errors.mojo +++ b/test/test_errors.mojo @@ -12,7 +12,7 @@ def _assert_lc(source: String, offset: Int, line: Int, col: Int) raises: def _msg(e: Error) -> String: - return String.write(e) + return String(e) def _strict_drain(var source: String) raises: