diff --git a/Tests/RegexBuilderTests/GoodBadFunctionTests.swift b/Tests/RegexBuilderTests/GoodBadFunctionTests.swift new file mode 100644 index 000000000..33af425fb --- /dev/null +++ b/Tests/RegexBuilderTests/GoodBadFunctionTests.swift @@ -0,0 +1,18 @@ +import XCTest +import _StringProcessing +@testable import RegexBuilder + +func goodFunction(_ r: some RegexComponent) { + _ = try? r.regex.firstMatch(in: "...") +} + +fileprivate func badFunction(_ r: Regex) { + _ = try? r.firstMatch(in: "...") +} + +class GoodBadFunctionTests: XCTestCase { + func testGoodBadFunctions() { + goodFunction(Regex { "asdf" }) + badFunction(Regex { "asdf" }) + } +}