Skip to content

Remove a few unintended Foundation dependencies from our unit tests. #406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Tests/TestingTests/ABIEntryPointTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct ABIEntryPointTests {
arguments.filter = ["NonExistentTestThatMatchesNothingHopefully"]
let argumentsJSON = try JSON.withEncoding(of: arguments) { argumentsJSON in
let result = UnsafeMutableRawBufferPointer.allocate(byteCount: argumentsJSON.count, alignment: 1)
argumentsJSON.copyBytes(to: result)
_ = memcpy(result.baseAddress!, argumentsJSON.baseAddress!, argumentsJSON.count)
return result
}
defer {
Expand Down
6 changes: 3 additions & 3 deletions Tests/TestingTests/Test.Case.Argument.IDTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct Test_Case_Argument_IDTests {
#expect(testCase.arguments.count == 1)
let argument = try #require(testCase.arguments.first)
let argumentID = try #require(argument.id)
#expect(String(bytes: argumentID.bytes, encoding: .utf8) == "123")
#expect(String(decoding: argumentID.bytes, as: UTF8.self) == "123")
}

@Test("One CustomTestArgumentEncodable parameter")
Expand Down Expand Up @@ -56,7 +56,7 @@ struct Test_Case_Argument_IDTests {
#expect(testCase.arguments.count == 1)
let argument = try #require(testCase.arguments.first)
let argumentID = try #require(argument.id)
#expect(String(bytes: argumentID.bytes, encoding: .utf8) == #""abc""#)
#expect(String(decoding: argumentID.bytes, as: UTF8.self) == #""abc""#)
}

@Test("One RawRepresentable parameter")
Expand All @@ -70,7 +70,7 @@ struct Test_Case_Argument_IDTests {
#expect(testCase.arguments.count == 1)
let argument = try #require(testCase.arguments.first)
let argumentID = try #require(argument.id)
#expect(String(bytes: argumentID.bytes, encoding: .utf8) == #""abc""#)
#expect(String(decoding: argumentID.bytes, as: UTF8.self) == #""abc""#)
}
}

Expand Down