Gleam expect doesn't exit in tests
To ensure all tests can run
@@ -15,6 +15,7 @@ use termcolor::Buffer;
pub type Src = String;
pub type Name = String;
+#[cfg(not(test))]
pub fn fatal_compiler_bug(msg: &str) -> ! {
let buffer_writer = cli::stderr_buffer_writer();
let mut buffer = buffer_writer.buffer();
@@ -42,6 +43,11 @@ with this information and the code that produces the crash:
std::process::exit(1);
}
+#[cfg(test)]
+pub fn fatal_compiler_bug(msg: &str) -> ! {
+ panic!("{}", msg)
+}
+
pub trait GleamExpect<T> {
fn gleam_expect(self, msg: &str) -> T;
}
