-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for TestMethodNameConverter
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
Tests/RevolutionKitTests/TestMethodNameConverterTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Testing | ||
@testable import RevolutionKit | ||
|
||
struct TestMethodNameConverterTests { | ||
private static let fixtures = [ | ||
(true, "testDoSomething", "doSomething"), | ||
(false, "testDoSomething", "testDoSomething"), | ||
(true, "test_do_something", "do_something"), | ||
(false, "test_do_something", "test_do_something"), | ||
(true, "test", "test"), | ||
(false, "test", "test"), | ||
] | ||
|
||
@Test("TestMethodNameConverter can convert method names", arguments: fixtures) | ||
func testConversion(enableStripping: Bool, input: String, expected: String) { | ||
let converter = TestMethodNameConverter(shouldStripPrefix: enableStripping) | ||
|
||
let actual = converter.convert(input) | ||
#expect(actual == expected) | ||
} | ||
} |