Skip to content

Commit

Permalink
Update TestInput tests for new behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
d-torrance committed Sep 2, 2024
1 parent ce8d688 commit 5f3b2fe
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions M2/Macaulay2/tests/normal/testing.m2
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ loadPackage("TestPackage", FileName => testpkg)
check "TestPackage"
pkgtest = tests(0, "TestPackage")
assert instance(pkgtest, TestInput)
assert Equation(toSequence locate pkgtest, (testpkg, 3, 1, 4, 1,,))
assert Equation(toString pkgtest, testpkg | ":3:1-4:1")
assert Equation(net pkgtest, "TestInput[" | testpkg | ":3:1-4:1]")
expectedCode = " -- " | toAbsolutePath testpkg |
":4:1: location of test code" | newline | "assert Equation(1 + 1, 2)"
assert Equation(code pkgtest, expectedCode)
assert Equation(code 0, expectedCode)

assert Equation(toSequence locate pkgtest, (testpkg, 3, 5, 3, 32, 3, 5))
assert Equation(toString pkgtest, "assert Equation(1 + 1, 2)")
assert Equation(net pkgtest, "TestInput[" | testpkg | ":3:5-3:32]")
beginDocumentation()
expectedCode = DIV{
new FilePosition from (testpkg, 3, 5, 3, 32, 3, 5),
": --source code:",
PRE{CODE{"class" => "language-macaulay2",
"TEST \"assert Equation(1 + 1, 2)\""}}}
assert BinaryOperation(symbol ===, code pkgtest, expectedCode)
assert BinaryOperation(symbol ===, code 0, expectedCode)

assert( (for i from 1 to 2 list { for j from 1 to 2 do { if j == 2 then break 444; } }) === {{444}, {444}} ) -- see issue #2522

Expand Down

0 comments on commit 5f3b2fe

Please sign in to comment.