Skip to content

Commit

Permalink
Add formatter tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GearsDatapacks authored and lpil committed Nov 20, 2024
1 parent 56d0d61 commit 9d9e48e
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion compiler-core/src/format/tests/conditional_compilation.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::assert_format;
use crate::{assert_format, assert_format_rewrite};

#[test]
fn multiple() {
Expand All @@ -17,3 +17,33 @@ type Z {
"
);
}

#[test]
fn formatter_removes_target_shorthand_erlang() {
assert_format_rewrite!(
"@target(erl)
fn wibble() {
todo
}",
"@target(erlang)
fn wibble() {
todo
}
"
);
}

#[test]
fn formatter_removes_target_shorthand_javascript() {
assert_format_rewrite!(
"@target(js)
fn wibble() {
todo
}",
"@target(javascript)
fn wibble() {
todo
}
"
);
}

0 comments on commit 9d9e48e

Please sign in to comment.