Fork of daniellemaywood.uk/gleam — Wasm codegen work
Something went wrong. Try again.
1.1 kB · 88 lines
Rust
at wasm
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889// SPDX-License-Identifier: Apache-2.0// SPDX-FileCopyrightText: 2021 The Gleam contributors
use crate::{assert_js, assert_ts_def};
#[test]fn without_message() { assert_js!( r#"pub fn go() { todo}"#, );}
#[test]fn without_message_typescript() { assert_ts_def!( r#"pub fn go() { todo}"#, );}
#[test]fn with_message() { assert_js!( r#"pub fn go() { todo as "I should do this"}"#, );}
#[test]fn with_message_expr() { assert_js!( r#"pub fn go() { let x = "I should " <> "do this" todo as x}"#, );}
// https://github.com/gleam-lang/gleam/issues/1238#[test]fn as_expression() { assert_js!( r#"pub fn go(f) { let boop = todo as "I should do this" f(todo as "Boom")}"#, );}
// https://github.com/gleam-lang/gleam/issues/4471#[test]fn case_message() { assert_js!( r#"pub fn unimplemented(message) { panic as case message { Ok(message) -> message Error(_) -> "No message provided" }}"# );}
#[test]fn inside_fn() { assert_js!( r#"pub fn main() { fn() { todo }}"# );}