File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
app/depict/src/test/java/org/openscience/cdk/depict Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 1- /*
2- * Copyright (c) 2018 Saulius Gražulis <grazulis@ibt.lt >
1+ /* Copyright (c) 2018 Saulius Gražulis <grazulis@ibt.lt>
2+ * 2021 Egon Willighagen <egonw@users.sf.net >
33 *
44 * Contact: cdk-devel@lists.sourceforge.net
55 *
@@ -69,4 +69,16 @@ public void depictAsEps2() throws CDKException {
6969 assertEquals ("%%BoundingBox: 0 0 92 33" , lines [1 ]);
7070 }
7171
72+ @ Test
73+ public void depictAsSvg () throws CDKException {
74+ DepictionGenerator dg = new DepictionGenerator ();
75+ SmilesParser sp = new SmilesParser (SilentChemObjectBuilder .getInstance ());
76+ IAtomContainer ac = sp .parseSmiles ("[nH]1cccc1" );
77+ String svg = dg .depict (ac ).toSvgStr ();
78+ String nl = System .getProperty ("line.separator" );
79+ String lines [] = svg .split (nl ,3 );
80+ assertEquals ("<?xml version='1.0' encoding='UTF-8'?>" , lines [0 ]);
81+ assertEquals ("<!DOCTYPE svg PUBLIC \" -//W3C//DTD SVG 1.1//EN\" \" http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\" >" , lines [1 ]);
82+ }
83+
7284}
You can’t perform that action at this time.
0 commit comments