summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvisvgm/dvisvgm-src/tests/SVGOutputTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/dvisvgm/dvisvgm-src/tests/SVGOutputTest.cpp')
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/tests/SVGOutputTest.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/tests/SVGOutputTest.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/tests/SVGOutputTest.cpp
index 516edc16025..8fbe5adbd75 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/tests/SVGOutputTest.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/tests/SVGOutputTest.cpp
@@ -95,6 +95,38 @@ TEST_F(SVGOutputTest, expressions) {
}
+TEST_F(SVGOutputTest, hashes) {
+ SVGOutput::HashTriple hashes("dvihash", "opthash", "cmbhash");
+ {
+ SVGOutput out("SVGOutputTest.cpp", "%f-%hd-x");
+ EXPECT_EQ(out.filename(1, 10), "SVGOutputTest--x.svg");
+ EXPECT_EQ(out.filename(1, 10, hashes), "SVGOutputTest-dvihash-x.svg");
+ }{
+ SVGOutput out("SVGOutputTest.cpp", "%f-%hd-x-%hc%ho");
+ EXPECT_EQ(out.filename(1, 10), "SVGOutputTest--x-.svg");
+ EXPECT_EQ(out.filename(1, 10, hashes), "SVGOutputTest-dvihash-x-cmbhashopthash.svg");
+ }{
+ SVGOutput out("SVGOutputTest.cpp", "%f-%hd%p%ho");
+ EXPECT_EQ(out.filename(1, 10), "SVGOutputTest-01.svg");
+ EXPECT_EQ(out.filename(1, 10, hashes), "SVGOutputTest-dvihash01opthash.svg");
+ }
+}
+
+
+TEST_F(SVGOutputTest, hashes_fail) {
+ SVGOutput::HashTriple hashes("dvihash", "opthash", "cmbhash");
+ {
+ SVGOutput out("SVGOutputTest.cpp", "%f-%h-x");
+ EXPECT_THROW(out.filename(1, 10), MessageException);
+ EXPECT_THROW(out.filename(1, 10, hashes), MessageException);
+ }{
+ SVGOutput out("SVGOutputTest.cpp", "%f-%hd-x-%ha%ho");
+ EXPECT_THROW(out.filename(1, 10), MessageException);
+ EXPECT_THROW(out.filename(1, 10, hashes), MessageException);
+ }
+}
+
+
TEST_F(SVGOutputTest, getPageStream) {
{
SVGOutput out("", "");