swift-numerics icon indicating copy to clipboard operation
swift-numerics copied to clipboard

[BigInt tests] ❌ Binary `&&`, `||` and `^`

Open LiarPrincess opened this issue 2 years ago • 0 comments
trafficstars

Please read the #242 Using tests from “Violet - Python VM written in Swift” before.


❌ Failures

From what I see all of the xor tests fail.

func test_xor_truthTable() {
  typealias Word = BigIntPrototype.Word
  let lhsWord: Word = 0b1100
  let rhsWord: Word = 0b1010

  let lhs = BigInt(.positive, magnitude: lhsWord)
  let rhs = BigInt(.positive, magnitude: rhsWord)

  let expected = BigInt(lhsWord ^ rhsWord)
  XCTAssertEqual(lhs ^ rhs, expected)
  XCTAssertEqual(rhs ^ lhs, expected)
}

LiarPrincess avatar Jan 18 '23 15:01 LiarPrincess