Commit 5d86c7c2f0

5d86c7c2f04591063f5b032c351421c560bb549f

parent: 4a2c5403dc

Verified · cmc

cmc <hello@cleberg.net> · 2026-11-21 18:03 UTC

Don't count Calc refusals as skipped where Calc itself fails

Layout: unified · split

Tests/OrgCoreTests/CalcTests.swift +3 −2
@@ -244,7 +244,8 @@ struct CalcTests {
244244 let ours: String
245245 do { ours = try Calc.evaluate(c.0, modes: modes) } catch { ours = "unsupported: \(error)" }
246246 if ours.hasPrefix("unsupported") {
247 skipped.append(c.0)
247 // Calc can fail too, e.g. a root whose Newton steps never settle.
248 if !expected.hasPrefix("LISP ERROR") { skipped.append(c.0) }
248249 continue
249250 }
250251 #expect(ours == expected, "\(c.0) \(c.1) p\(precision)")
@@ -322,7 +323,7 @@ struct CalcTests {
322323 "8^(1:3)", "1.5^3"].map { ($0, "(float 0)") }
323324 if precision <= 14 {
324325 cases += ["sqrt(2)", "sinh(1)", "log(10,2)", "nroot(10,3)", "vgmean([1,2,3])", "exp(1)", "sin(30)", "2^0.5",
325 "exp(1.58)", "ln(9.44)", "0.08^1.5", "0.11^1.5", "exp(8.44)", "pow(2.5,1:3)"].map { ($0, "(float 0)") }
326 "exp(1.58)", "ln(9.44)", "0.08^1.5", "0.11^1.5", "exp(8.44)", "pow(2.5,1:3)", "(599e-2)^(5:7)"].map { ($0, "(float 0)") }
326327 // exp, ln and powers round at two digits more first.
327328 for _ in 0..<150 {
328329 let x = "\(Int.random(in: 1...999, using: &generator))e-2"