Skip to content
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: 2 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ jobs:
with:
path: ~/.local/share/swiftly/toolchains
key: swiftly-wasm-6.3.2-${{ runner.os }}
- name: Install system dependencies
run: sudo apt-get -y install libcurl4-openssl-dev
- name: Install Swift Toolchain
run: |
curl -O https://download.swift.org/swiftly/linux/swiftly-$(uname -m).tar.gz && \
Expand Down
8 changes: 3 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:6.3
// swift-tools-version:6.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This downgrade and the removal of swiftSettings: [.enableExperimentalFeature("StrictConcurrency")]) is far bigger than just testing changes, and should have warranted a separate commit.

//
// Package.swift
// BigInt
Expand All @@ -24,10 +24,8 @@ let package = Package(
],
targets: [
.target(
name: "BigInt", path: "Sources",
swiftSettings: [.enableExperimentalFeature("StrictConcurrency")]),
name: "BigInt", path: "Sources"),
.testTarget(
name: "BigIntTests", dependencies: ["BigInt"], path: "Tests",
swiftSettings: [.enableExperimentalFeature("StrictConcurrency")]),
name: "BigIntTests", dependencies: ["BigInt"], path: "Tests"),
]
)
774 changes: 382 additions & 392 deletions Tests/BigIntTests/BigIntTests.swift

Large diffs are not rendered by default.

942 changes: 444 additions & 498 deletions Tests/BigIntTests/BigUIntTests.swift

Large diffs are not rendered by default.

27 changes: 10 additions & 17 deletions Tests/BigIntTests/Violet - Helpers/WordsTestCases.swift
Original file line number Diff line number Diff line change
@@ -1,37 +1,30 @@
// This file was written by LiarPrincess for Violet - Python VM written in Swift.
// https://github.com/LiarPrincess/Violet

import XCTest
import Testing
@testable import BigInt

// MARK: - Asserts

internal func XCTAssertWords(_ value: BigInt,
_ expected: [UInt],
file: StaticString = #file,
line: UInt = #line) {
XCTAssertWords(
internal func expectWords(_ value: BigInt,
_ expected: [UInt]) {
expectWords(
value: String(value, radix: 10, uppercase: false),
words: Array(value.words),
expected: expected,
file: file,
line: line
expected: expected
)
}

private func XCTAssertWords(value: String,
words: [UInt],
expected: [UInt],
file: StaticString,
line: UInt) {
XCTAssertEqual(words.count, expected.count, "Count for \(value)", file: file, line: line)
private func expectWords(value: String,
words: [UInt],
expected: [UInt]) {
#expect(words.count == expected.count, "Count for \(value)")
guard words.count == expected.count else {
return
}

// deconstruction nested in deconstruction? eh…
for (index, (w, e)) in zip(words, expected).enumerated() {
XCTAssertEqual(w, e, "Word \(index) for \(value)", file: file, line: line)
#expect(w == e, "Word \(index) for \(value)")
}
}

Expand Down
Loading
Loading