Fork of daniellemaywood.uk/gleam — Wasm codegen work
2

Configure Feed

Select the types of activity you want to include in your feed.

gleam / format / src / tests / conditional_compilation.rs
677 B 52 lines
1// SPDX-License-Identifier: Apache-2.0 2// SPDX-FileCopyrightText: 2023 The Gleam contributors 3 4use crate::{assert_format, assert_format_rewrite}; 5 6#[test] 7fn multiple() { 8 assert_format!( 9 "type X 10 11@target(erlang) 12type Y { 13 Y 14} 15 16@target(javascript) 17type Z { 18 Z 19} 20" 21 ); 22} 23 24#[test] 25fn formatter_removes_target_shorthand_erlang() { 26 assert_format_rewrite!( 27 "@target(erl) 28fn wibble() { 29 todo 30}", 31 "@target(erlang) 32fn wibble() { 33 todo 34} 35" 36 ); 37} 38 39#[test] 40fn formatter_removes_target_shorthand_javascript() { 41 assert_format_rewrite!( 42 "@target(js) 43fn wibble() { 44 todo 45}", 46 "@target(javascript) 47fn wibble() { 48 todo 49} 50" 51 ); 52}