Skip to content

Commit

Permalink
add gc test for minimal scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaBatty committed Sep 17, 2024
1 parent 453e5af commit a61f3a1
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
out
target
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[project]
authors = ["Fuel Labs <contact@fuel.sh>"]
entry = "main.sw"
license = "Apache-2.0"
name = "minimal_script"
implicit-std = false

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
script;

struct MyStruct {
field1: u16,
}

fn func(s: MyStruct) -> u16 {
s.field1
}

fn main() {
let x = MyStruct { field1: 10 };
let y = func(x);
}
8 changes: 8 additions & 0 deletions sway-lsp/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,14 @@ fn garbage_collection_paths() {
garbage_collection_runner(p);
}

#[test]
fn garbage_collection_minimal_script() {
let p = sway_workspace_dir()
.join("sway-lsp/tests/fixtures/garbage_collection/minimal_script")
.join("src/main.sw");
garbage_collection_runner(p);
}

#[test]
fn lsp_syncs_with_workspace_edits() {
run_async!({
Expand Down

0 comments on commit a61f3a1

Please sign in to comment.