Skip to content

Commit 711e4a8

Browse files
committed
Fix tests broken in debug mode
We remove some unrelated stmts from a test case, and gate another one behind a cfg flag
1 parent 42a66fe commit 711e4a8

File tree

4 files changed

+24
-5
lines changed

4 files changed

+24
-5
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,17 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v4
2121
- name: Test (Luau)
22-
run: cargo test --features luau --release # TODO: ideally we don't need to run in release mode!
22+
run: cargo test --features luau
23+
24+
# TODO: ideally this step isn't needed, but we have to gate some tests behind release mode
25+
# we do this to ensure they still run in CI
26+
# https://github.com/Kampfkarren/full-moon/issues/140
27+
test_luau_release:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
- name: Test (Luau - Release mode)
32+
run: cargo test --features luau --release
2333

2434
test_lua52:
2535
runs-on: ubuntu-latest

tests/inputs-luau/assignment-hang-1.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ exports.separateDisplayNameAndHOCs =
2222
displayName = nextMatch
2323
hocDisplayNames = {}
2424
while nextMatch :: any ~= nil do
25-
nextMatch = matches()
26-
table.insert(hocDisplayNames :: Array<string>, nextMatch)
25+
-- TODO: https://github.com/Kampfkarren/full-moon/issues/140
26+
-- Including the following statements cause a stack overflow:
27+
-- nextMatch = matches()
28+
-- table.insert(hocDisplayNames :: Array<string>, nextMatch)
2729
end
2830
end
2931
end

tests/snapshots/[email protected]

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
source: tests/tests.rs
33
expression: format(&contents)
4+
input_file: tests/inputs-luau/assignment-hang-1.lua
45
---
56
-- https://github.com/JohnnyMorganz/StyLua/issues/439
67
exports.separateDisplayNameAndHOCs = function(
@@ -28,8 +29,10 @@ exports.separateDisplayNameAndHOCs = function(
2829
displayName = nextMatch
2930
hocDisplayNames = {}
3031
while nextMatch :: any ~= nil do
31-
nextMatch = matches()
32-
table.insert(hocDisplayNames :: Array<string>, nextMatch)
32+
-- TODO: https://github.com/Kampfkarren/full-moon/issues/140
33+
-- Including the following statements cause a stack overflow:
34+
-- nextMatch = matches()
35+
-- table.insert(hocDisplayNames :: Array<string>, nextMatch)
3336
end
3437
end
3538
end

tests/test_ranges.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ fn test_incomplete_range() {
9292
}
9393

9494
#[test]
95+
#[cfg_attr(
96+
all(debug_assertions, feature = "luau"),
97+
ignore = "fails in debug mode" // TODO: https://github.com/Kampfkarren/full-moon/issues/140
98+
)]
9599
fn test_large_example() {
96100
insta::assert_snapshot!(
97101
format(

0 commit comments

Comments
 (0)