Skip to content

Commit

Permalink
Drop unnecessary "test number" key from packages
Browse files Browse the repository at this point in the history
Now that the test inputs are stored in a list, we can just use the
length of the list.
  • Loading branch information
d-torrance committed Aug 21, 2024
1 parent fa84d1c commit d492768
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion M2/Macaulay2/m2/packages.m2
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ newPackage String := opts -> pkgname -> (
"previous currentPackage" => currentPackage,
"previous dictionaries" => dictionaryPath,
"previous packages" => loadedPackages,
"test number" => 0,
"test inputs" => new MutableList,
"raw documentation" => new MutableHashTable, -- deposited here by 'document'
"processed documentation" => new MutableHashTable, -- the output from 'documentation', look here first
Expand Down
5 changes: 2 additions & 3 deletions M2/Macaulay2/m2/testing.m2
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ editMethod TestInput := editMethod @@ locate
TEST = method(Options => {FileName => false})
TEST List := opts -> testlist -> apply(testlist, test -> TEST(test, opts))
TEST String := opts -> teststring -> (
n := currentPackage#"test number";
n := #currentPackage#"test inputs";
if opts.FileName then (
filename := teststring;
teststring = get filename;
Expand All @@ -36,8 +36,7 @@ TEST String := opts -> teststring -> (
"location" => new FilePosition from {
minimizeFilename filename,
start, 1, stop, 80}, -- TODO: get actual final column
"code" => teststring};
currentPackage#"test number" += 1;)
"code" => teststring};)
-- TODO: support test titles

-----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion M2/Macaulay2/packages/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ set(M2_INSTALL_TEMPLATE [[installPackage("@package@",
DebuggingMode => true)]])
set(M2_NEED_TEMPLATE [[needsPackage("@package@", LoadDocumentation=>true, DebuggingMode=>true)]])
set(M2_TEST_TEMPLATE [[debug Core \; argumentMode = @ArgumentMode@ \; check(@_i@, "@package@")]])
set(M2_INFO_TEMPLATE [["info-"|"@package@" << @package@#"test number" << close]]) # ignore the color
set(M2_INFO_TEMPLATE [["info-"|"@package@" << #@package@#"test inputs" << close]]) # ignore the color
set(M2_CHECK_TEMPLATE [[check("@package@", UserMode=>false, Verbose=>$<IF:$<BOOL:${VERBOSE}>,true,false>)]])

# TODO: simplify
Expand Down

0 comments on commit d492768

Please sign in to comment.