From 3a69633a5a8d8d2ede5cfd1c4e45af7d542b4f09 Mon Sep 17 00:00:00 2001 From: Anthony Drendel Date: Sun, 19 Mar 2023 15:48:24 +0100 Subject: [PATCH] Update .swiftformat --- .swiftformat | 1 + Tests/WasmInterpreterTests/WasmInterpreterTests.swift | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.swiftformat b/.swiftformat index aaa1374..74fe761 100644 --- a/.swiftformat +++ b/.swiftformat @@ -2,6 +2,7 @@ hoistAwait, \ hoistTry +--decimalgrouping 3,5 --funcattributes prev-line --minversion 0.47.2 --maxwidth 96 diff --git a/Tests/WasmInterpreterTests/WasmInterpreterTests.swift b/Tests/WasmInterpreterTests/WasmInterpreterTests.swift index d490005..7c46362 100644 --- a/Tests/WasmInterpreterTests/WasmInterpreterTests.swift +++ b/Tests/WasmInterpreterTests/WasmInterpreterTests.swift @@ -5,7 +5,7 @@ final class WasmInterpreterTests: XCTestCase { func testCallingTwoFunctionsWithSameImplementation() throws { let mod = try ConstantModule() - try (1 ... 10).forEach { XCTAssertEqual(65536, try mod.constant(version: $0)) } + try (1 ... 10).forEach { XCTAssertEqual(65_536, try mod.constant(version: $0)) } XCTAssertThrowsError(try mod.constant(version: 11)) { error in guard case let .wasm3Error(msg) = error as? WasmInterpreterError @@ -19,7 +19,7 @@ final class WasmInterpreterTests: XCTestCase { XCTAssertEqual(0, try mod.add(-1, 1)) XCTAssertEqual(0, try mod.add(0, 0)) XCTAssertEqual(3, try mod.add(1, 2)) - XCTAssertEqual(910_861, try mod.add(13425, 897_436)) + XCTAssertEqual(910_861, try mod.add(13_425, 897_436)) } func testPassingAndReturning64BitValues() throws { @@ -28,7 +28,7 @@ final class WasmInterpreterTests: XCTestCase { XCTAssertEqual(1, try mod.calculateValue(at: 1)) XCTAssertEqual(1, try mod.calculateValue(at: 2)) XCTAssertEqual(5, try mod.calculateValue(at: 5)) - XCTAssertEqual(75025, try mod.calculateValue(at: 25)) + XCTAssertEqual(75_025, try mod.calculateValue(at: 25)) } func testUsingImportedFunction() throws { @@ -63,7 +63,7 @@ final class WasmInterpreterTests: XCTestCase { try mod.write(fortyTwo, to: 1) XCTAssertEqual(42, try mod.integers(at: 1, length: 1).first) - XCTAssertEqual(10753, try mod.integers(at: 0, length: 1).first) + XCTAssertEqual(10_753, try mod.integers(at: 0, length: 1).first) let goodbye = "Goodbye!" XCTAssertNoThrow(try mod.writeASCIICharacters(in: goodbye, to: 2))