Skip to content

Unit test cleanup - #1553

Open
drgrice1 wants to merge 2 commits into
openwebwork:developfrom
drgrice1:unit-test-cleanup
Open

drgrice1 wants to merge 2 commits into
openwebwork:developfrom
drgrice1:unit-test-cleanup

Conversation

@drgrice1

@drgrice1 drgrice1 commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Remove some use Data::Dumper calls that keep showing up for some reason.

Remove some other dependencies that aren't needed. In some cases macros are loaded that aren't needed, and in others packages are used that aren't needed.

Restructure the t directories and file names to be more logical.

The .pg problem files that were not actual tests were converted into tests.

  • Tests that replace the tikz_text?.pg problems were added in the t/macros_graph/PGtikz.t file.
  • Tests that replace the latex_image_test?.pg problems are in the new t/macros_graph/PGlateximage.t file.
  • Tests that replace the niceTables.pg file are added in the t/macros_ui/niceTables.t file.

There was a bug in the lib/LaTeXImage.pm file that was fixed. If $image->texPackages([['xcolor', 'dvipsnames']]) is called (or generally the array option version with the package xcolorcalled), then\usepackage[dvipsnames]{xcolor}is added twice to the TeX. This is because the array reference isne 'xcolor'`.

There was also a bug in the niceTables.pl macro that was fixed. The css method in the macro did not append the css properties to the $return string, and so it only actually added the last css property considered. Which css property considered was random also, because the keys order would be different every time.

@drgrice1
drgrice1 force-pushed the unit-test-cleanup branch 3 times, most recently from 4caca52 to 4f66e8a Compare September 27, 2026 15:53
drgrice1 and others added 2 commits September 28, 2026 06:41
Remove some `use Data::Dumper` calls that keep showing up for some
reason.

Remove some other dependencies that aren't needed.  In some cases macros
are loaded that aren't needed, and in others packages are `use`d that
aren't needed.

Restructure the `t` directories and file names to be more logical.
Tests that replace the `tikz_text?.pg` problems were added in the
`t/macros_graph/PGtikz.t` file.

Tests that replace the `latex_image_test?.pg` problems are in the new
`t/macros_graph/PGlateximage.t` file.

Tests that replace the `niceTables.pg` file are added in the
`t/macros_ui/niceTables.t` file.

There was a bug in the `lib/LaTeXImage.pm` file that was fixed. If
`$image->texPackages([['xcolor', 'dvipsnames']]) is called (or generally
the array option version with the package `xcolor` called), then
`\usepackage[dvipsnames]{xcolor}` is added twice to the TeX.  This is
because the array reference is `ne 'xcolor'`.

There was also a bug in the `niceTables.pl` macro that was fixed.  The
`css` method in the macro did not append the css properties to the
`$return` string, and so it only actually added the last css property
considered.  Which css property considered was random also, because the
`keys` order would be different every time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants