pixie/tests/test_svg.nim

24 lines
466 B
Nim
Raw Normal View History

2020-12-20 00:01:14 +00:00
import pixie/fileformats/svg, pixie, strformat
2020-12-04 16:17:03 +00:00
2020-12-20 00:01:14 +00:00
const files = [
2020-12-20 03:59:43 +00:00
"line01",
"polyline01",
"polygon01",
"rect01",
"rect02",
"circle01",
2020-12-20 18:17:55 +00:00
"ellipse01",
2020-12-20 00:01:14 +00:00
"triangle01",
2020-12-20 02:47:05 +00:00
"quad01",
2020-12-20 00:01:14 +00:00
"Ghostscript_Tiger"
]
2020-12-04 20:09:08 +00:00
2020-12-20 00:01:14 +00:00
for file in files:
let
original = readFile(&"tests/images/svg/{file}.svg")
image = decodeSvg(original)
gold = readImage(&"tests/images/svg/{file}.png")
doAssert image.data == gold.data
#image.writeFile(&"tests/images/svg/{file}.png")