From 87f5afe5a38e0849f8acb61d11dfab1a27974180 Mon Sep 17 00:00:00 2001 From: JohnnyMorganz Date: Sat, 22 Jun 2024 11:31:29 +0200 Subject: [PATCH] Fix tests and re-enable large example in debug mode --- .github/workflows/ci.yml | 10 ---------- tests/test_ranges.rs | 4 ---- tests/tests.rs | 6 +++--- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f8a9e18..b6155d2d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,16 +21,6 @@ jobs: - name: Test (Luau) run: cargo test --features luau - # TODO: ideally this step isn't needed, but we have to gate some tests behind release mode - # we do this to ensure they still run in CI - # https://github.com/Kampfkarren/full-moon/issues/140 - test_luau_release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Test (Luau - Release mode) - run: cargo test --features luau --release - test_lua52: runs-on: ubuntu-latest steps: diff --git a/tests/test_ranges.rs b/tests/test_ranges.rs index a0ee070a..3fece4e3 100644 --- a/tests/test_ranges.rs +++ b/tests/test_ranges.rs @@ -92,10 +92,6 @@ fn test_incomplete_range() { } #[test] -#[cfg_attr( - all(debug_assertions, feature = "luau"), - ignore = "fails in debug mode" // TODO: https://github.com/Kampfkarren/full-moon/issues/140 -)] fn test_large_example() { insta::assert_snapshot!( format( diff --git a/tests/tests.rs b/tests/tests.rs index ad5a8f18..c5a49b43 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -3,9 +3,9 @@ use stylua_lib::{ SortRequiresConfig, }; -fn format(input: &str, lua_version: LuaVersion) -> String { +fn format(input: &str, syntax: LuaVersion) -> String { let config = Config { - lua_version, + syntax, ..Config::default() }; format_code(input, config, None, OutputVerification::None).unwrap() @@ -110,7 +110,7 @@ fn test_collapse_single_statement_lua_52() { end "###, Config { - lua_version: LuaVersion::Lua52, + syntax: LuaVersion::Lua52, collapse_simple_statement: CollapseSimpleStatement::Always, ..Config::default() },