summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvisvgm/dvisvgm-src/tests/SVGOutputTest.cpp
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-09-13 17:10:25 +0000
committerKarl Berry <karl@freefriends.org>2018-09-13 17:10:25 +0000
commit854bfe4d7f98595f6566c169b98f237eb017f83f (patch)
tree7bff265a0ba15c3fdb666765f220655e55d74c20 /Build/source/texk/dvisvgm/dvisvgm-src/tests/SVGOutputTest.cpp
parentb3cade537fb6d988be46152d0959f896f9505cc5 (diff)
dvisvgm 2.6
git-svn-id: svn://tug.org/texlive/trunk@48654 c570f23f-e606-0410-a88d-b1316a301751
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("", "");