Closed d-torrance closed 1 month ago
Unrelated, but can we have tests
return a numbered vertical list?
i2 : tests User
o2 = HashTable{0 => TestInput[stdio:1:1-2:1]}
o2 : HashTable
i3 : code 0
Side note: it's a little alarming that User.PackageIsLoaded
is false.
PackageIsLoaded
is usually set by endPackage
, but that never gets called for User
. And it probably shouldn't -- but calling endPackage "User"
doesn't raise any errors.
I don't see why someone would call endPackage
on User, but I also don't see why it should be an error (for the same reasons as loadPackage
).
I should say that if you set PackageIsLoaded to true then your change in loadPackage is actually unnecessary to get check
working.
Good points!
I've changed this so that it's just the PackageIsLoaded
commit. check "User"
and needsPackage "User"
now work nicely. loadPackage "User"
still raises the "file not found" error, but I think that kind of makes sense since we can't really "load" it.
Oh yes, that makes sense!
Previously, we got an error because User.m2 doesn't exist.
The use case I was interested in is creating and running tests outside of a package:
So far, so good! But now:
The problem is due to loadPackage, which always tries to load a file. If we just immediately return the
User
package whenloadPackage "User"
is called, then everything works: