mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-22 08:17:40 +03:00
41 lines
935 B
Rust
41 lines
935 B
Rust
#[macro_use]
|
|
extern crate pretty_assertions;
|
|
#[macro_use]
|
|
extern crate indoc;
|
|
|
|
#[cfg(test)]
|
|
mod test_file {
|
|
use bumpalo::Bump;
|
|
use roc_editor::lang::roc_file::File;
|
|
use std::path::Path;
|
|
|
|
#[test]
|
|
fn read_and_fmt_simple_roc_module() {
|
|
let simple_module_path = Path::new("./tests/modules/SimpleUnformatted.roc");
|
|
|
|
let arena = Bump::new();
|
|
|
|
let file = File::read(simple_module_path, &arena)
|
|
.expect("Could not read SimpleUnformatted.roc in test_file test");
|
|
|
|
assert_eq!(
|
|
file.fmt(),
|
|
indoc!(
|
|
r#"
|
|
interface Simple
|
|
exposes [
|
|
v, x
|
|
]
|
|
imports []
|
|
|
|
v : Str
|
|
|
|
v = "Value!"
|
|
|
|
x : Int
|
|
x = 4"#
|
|
)
|
|
);
|
|
}
|
|
}
|