this repo has no description

Empty tests

+49 -5
+1 -1
.gitignore
··· 7 7 erl_crash.dump 8 8 *.lock 9 9 node_modules/ 10 - **/src/generated_tests.rs 10 + test-package-compiler/src/generated_tests.rs
+1 -1
Makefile
··· 41 41 42 42 .PHONY: test-watch 43 43 test-watch: ## Run compiler tests when files change 44 - watchexec -e rs,html,capnp "cargo test --quiet" 44 + watchexec --changes-only -e rs,gleam,html,capnp "cargo test --quiet" 45 45 46 46 # Debug print vars with `make print-VAR_NAME` 47 47 print-%: ; @echo $*=$($*)
-2
compiler-core/src/build/package_compilation_tests.rs
··· 159 159 160 160 #[test] 161 161 fn package_compiler_test() { 162 - assert_erlang_compile!(vec![], Ok(vec![])); 163 - 164 162 assert_erlang_compile!( 165 163 vec![Source { 166 164 path: PathBuf::from("src/one.gleam"),
+2
test-package-compiler/build.rs
··· 1 1 use std::path::PathBuf; 2 2 3 3 pub fn main() { 4 + println!("cargo:rerun-if-changed=cases"); 5 + 4 6 let mut module = "/// This file is generated by build.rs 5 7 /// Do not edit it directly, instead add new test cases to ./cases 6 8
+3
test-package-compiler/cases/erlang_empty/gleam.toml
··· 1 + name = "hello_joe" 2 + version = "0.1.0" 3 + target = "erlang"
+1
test-package-compiler/cases/erlang_empty/src/empty.gleam
··· 1 +
+3
test-package-compiler/cases/javascript_empty/gleam.toml
··· 1 + name = "hello_joe" 2 + version = "0.1.0" 3 + target = "javascript"
+1
test-package-compiler/cases/javascript_empty/src/empty.gleam
··· 1 +
+4 -1
test-package-compiler/src/lib.rs
··· 49 49 }), 50 50 }, 51 51 Target::JavaScript => TargetCodegenConfiguration::JavaScript { 52 - emit_typescript_definitions: true, 52 + emit_typescript_definitions: config.javascript.typescript_declarations, 53 53 }, 54 54 }; 55 55 ··· 99 99 buffer.push('\n'); 100 100 101 101 match content { 102 + _ if path.ends_with("gleam.mjs") || path.ends_with("gleam.d.ts") => { 103 + buffer.push_str("<prelude>") 104 + } 102 105 Content::Text(text) => buffer.push_str(text), 103 106 Content::Binary(data) => write!(buffer, "{:#?}", data).unwrap(), 104 107 };
+20
test-package-compiler/src/snapshots/test_package_compiler__generated_tests__erlang_empty.snap
··· 1 + --- 2 + source: test-package-compiler/src/generated_tests.rs 3 + assertion_line: 7 4 + expression: /Users/louis/src/gleam/gleam/test-package-compiler/cases/erlang_empty 5 + --- 6 + //// /out/lib/the_package/_gleam_artefacts/empty.erl 7 + -module(empty). 8 + 9 + 10 + //// /out/lib/the_package/ebin/hello_joe.app 11 + {application, hello_joe, [ 12 + {vsn, "0.1.0"}, 13 + {applications, []}, 14 + {description, ""}, 15 + {modules, [empty]}, 16 + {registered, []} 17 + ]}. 18 + 19 + 20 +
+13
test-package-compiler/src/snapshots/test_package_compiler__generated_tests__javascript_empty.snap
··· 1 + --- 2 + source: test-package-compiler/src/generated_tests.rs 3 + assertion_line: 19 4 + expression: /Users/louis/src/gleam/gleam/test-package-compiler/cases/javascript_empty 5 + --- 6 + //// /out/lib/the_package/empty.mjs 7 + export {} 8 + 9 + 10 + //// /out/lib/the_package/gleam.mjs 11 + <prelude> 12 + 13 +