Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-browser-engine

Source of release 0.6.0

0.6.0 / src / web / svg / tests_svg_cases.lucb

#==============================================================================================
#
#   tests_svg_cases - SVG attribute parsing, paths and SVG element cases pinned to the
#                     reference build
#
#   DESCRIPTION:
#       Generated (a test vector table) from the output of a local oracle that runs the
#       reference Ladybird build's LibWeb on the same inputs (luce-browser-tools,
#       oracles/luce-browser-engine/svg_elements: cases.txt, oracle.cpp, gen_luce_cases.py,
#       build.sh). tests_svg runs each case through the port and compares the output; floats
#       are their bits.
#
#==============================================================================================

## One oracle case: the mode, its arguments, and the reference build's output.
struct TestSvgCase:
    let mode: str
    let arguments: str[5]
    let expected: str

## Every oracle case, in cases.txt order (2 more, marked "!" in cases.txt, wait for other regions).
let test_svg_cases: TestSvgCase[199] = [
    TestSvgCase(mode = "coord", arguments = ["10", "", "", "", ""], expected = "41200000\n"),
    TestSvgCase(mode = "coord", arguments = ["  -3.5e2  ", "", "", "", ""], expected = "c3af0000\n"),
    TestSvgCase(mode = "coord", arguments = ["+.5", "", "", "", ""], expected = "3f000000\n"),
    TestSvgCase(mode = "coord", arguments = ["1.", "", "", "", ""], expected = "3f800000\n"),
    TestSvgCase(mode = "coord", arguments = [".", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "coord", arguments = ["-", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "coord", arguments = ["1e", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "coord", arguments = ["1e-3", "", "", "", ""], expected = "3a83126f\n"),
    TestSvgCase(mode = "coord", arguments = ["12px", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "coord", arguments = ["", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "coord", arguments = [" 1 2", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "coord", arguments = ["0x10", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "coord", arguments = ["1E+2", "", "", "", ""], expected = "42c80000\n"),
    TestSvgCase(mode = "coord", arguments = ["3.402823e39", "", "", "", ""], expected = "7f800000\n"),
    TestSvgCase(mode = "length", arguments = ["0.125", "", "", "", ""], expected = "3e000000\n"),
    TestSvgCase(mode = "length", arguments = ["-7", "", "", "", ""], expected = "c0e00000\n"),
    TestSvgCase(mode = "length", arguments = ["50%", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "poslen", arguments = ["-7", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "poslen", arguments = ["7.25", "", "", "", ""], expected = "40e80000\n"),
    TestSvgCase(mode = "poslen", arguments = ["0", "", "", "", ""], expected = "00000000\n"),
    TestSvgCase(mode = "poslen", arguments = ["-0", "", "", "", ""], expected = "80000000\n"),
    TestSvgCase(mode = "integer", arguments = ["42", "", "", "", ""], expected = "42\n"),
    TestSvgCase(mode = "integer", arguments = ["-17", "", "", "", ""], expected = "-17\n"),
    TestSvgCase(mode = "integer", arguments = ["+5", "", "", "", ""], expected = "5\n"),
    TestSvgCase(mode = "integer", arguments = ["1.5", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "integer", arguments = ["2147483647", "", "", "", ""], expected = "2147483647\n"),
    TestSvgCase(mode = "integer", arguments = ["2147483648", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "integer", arguments = [" 9 ", "", "", "", ""], expected = "9\n"),
    TestSvgCase(mode = "integer", arguments = [".5", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "numpct", arguments = ["50%", "", "", "", ""], expected = "3f000000 % 42fa0000\n"),
    TestSvgCase(mode = "numpct", arguments = ["12.5", "", "", "", ""], expected = "41480000 n 41480000\n"),
    TestSvgCase(mode = "numpct", arguments = ["-25%", "", "", "", ""], expected = "be800000 % c27a0000\n"),
    TestSvgCase(mode = "numpct", arguments = [" % ", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "numpct", arguments = ["3 %", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "numpct", arguments = ["1e2%", "", "", "", ""], expected = "3f800000 % 437a0000\n"),
    TestSvgCase(mode = "viewbox", arguments = ["0 0 100 50", "", "", "", ""], expected = "0000000000000000 0000000000000000 4059000000000000 4049000000000000\n"),
    TestSvgCase(mode = "viewbox", arguments = ["-10,-20,300.5,150", "", "", "", ""], expected = "c024000000000000 c034000000000000 4072c80000000000 4062c00000000000\n"),
    TestSvgCase(mode = "viewbox", arguments = ["0 0 100", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "viewbox", arguments = ["0,0,,100,50", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "viewbox", arguments = [" 1 2 3 4 ", "", "", "", ""], expected = "3ff0000000000000 4000000000000000 4008000000000000 4010000000000000\n"),
    TestSvgCase(mode = "viewbox", arguments = ["1 2 3 4 5", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "viewbox", arguments = ["1,2 3,4", "", "", "", ""], expected = "3ff0000000000000 4000000000000000 4008000000000000 4010000000000000\n"),
    TestSvgCase(mode = "viewbox", arguments = ["0 0 -1 -1", "", "", "", ""], expected = "0000000000000000 0000000000000000 bff0000000000000 bff0000000000000\n"),
    TestSvgCase(mode = "par", arguments = ["none", "", "", "", ""], expected = "0 0\n"),
    TestSvgCase(mode = "par", arguments = ["xMinYMin", "", "", "", ""], expected = "1 0\n"),
    TestSvgCase(mode = "par", arguments = ["xMidYMid meet", "", "", "", ""], expected = "5 0\n"),
    TestSvgCase(mode = "par", arguments = ["xMaxYMax slice", "", "", "", ""], expected = "9 1\n"),
    TestSvgCase(mode = "par", arguments = ["  xMinYMax   slice  ", "", "", "", ""], expected = "7 1\n"),
    TestSvgCase(mode = "par", arguments = ["xminymin", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "par", arguments = ["xMidYMid foo", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "par", arguments = ["", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "par", arguments = ["slice", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "par", arguments = ["xMidYMid meet extra", "", "", "", ""], expected = "5 0\n"),
    TestSvgCase(mode = "units", arguments = ["userSpaceOnUse", "", "", "", ""], expected = "1\n"),
    TestSvgCase(mode = "units", arguments = ["objectBoundingBox", "", "", "", ""], expected = "0\n"),
    TestSvgCase(mode = "units", arguments = ["  objectBoundingBox  ", "", "", "", ""], expected = "0\n"),
    TestSvgCase(mode = "units", arguments = ["userspaceonuse", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "units", arguments = ["", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "spread", arguments = ["pad", "", "", "", ""], expected = "0\n"),
    TestSvgCase(mode = "spread", arguments = ["repeat", "", "", "", ""], expected = "1\n"),
    TestSvgCase(mode = "spread", arguments = ["reflect", "", "", "", ""], expected = "2\n"),
    TestSvgCase(mode = "spread", arguments = ["Repeat", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "table", arguments = ["0 0.5 1", "", "", "", ""], expected = "table 00000000 3f000000 3f800000\n"),
    TestSvgCase(mode = "table", arguments = ["1,0.25 , 0", "", "", "", ""], expected = "table 3f800000 3e800000 00000000\n"),
    TestSvgCase(mode = "table", arguments = [" 0.1 ", "", "", "", ""], expected = "table 3dcccccd\n"),
    TestSvgCase(mode = "table", arguments = ["-1 0", "", "", "", ""], expected = "table\n"),
    TestSvgCase(mode = "table", arguments = ["", "", "", "", ""], expected = "table\n"),
    TestSvgCase(mode = "table", arguments = ["1 x", "", "", "", ""], expected = "table\n"),
    TestSvgCase(mode = "points", arguments = ["0,0 10,20 30,5", "", "", "", ""], expected = "points 00000000 00000000 41200000 41a00000 41f00000 40a00000\n"),
    TestSvgCase(mode = "points", arguments = [" 1 2 3 4 5 6 ", "", "", "", ""], expected = "points 3f800000 40000000 40400000 40800000 40a00000 40c00000\n"),
    TestSvgCase(mode = "points", arguments = ["1,2,3,4", "", "", "", ""], expected = "points 3f800000 40000000 40400000 40800000\n"),
    TestSvgCase(mode = "points", arguments = ["1 2 3", "", "", "", ""], expected = "points 3f800000 40000000\n"),
    TestSvgCase(mode = "points", arguments = ["", "", "", "", ""], expected = "points\n"),
    TestSvgCase(mode = "points", arguments = ["1e1,2e-1 -3,-4", "", "", "", ""], expected = "points 41200000 3e4ccccd c0400000 c0800000\n"),
    TestSvgCase(mode = "points", arguments = ["0 0 , 10 10", "", "", "", ""], expected = "points 00000000 00000000 41200000 41200000\n"),
    TestSvgCase(mode = "transform", arguments = ["translate(10)", "", "", "", ""], expected = "translate 41200000 00000000\nmatrix 3f800000 00000000 00000000 3f800000 41200000 00000000\n"),
    TestSvgCase(mode = "transform", arguments = ["translate(10, 20)", "", "", "", ""], expected = "translate 41200000 41a00000\nmatrix 3f800000 00000000 00000000 3f800000 41200000 41a00000\n"),
    TestSvgCase(mode = "transform", arguments = ["translate(-5 7.5) scale(2)", "", "", "", ""], expected = "translate c0a00000 40f00000\nscale 40000000 40000000\nmatrix 40000000 00000000 00000000 40000000 c0a00000 40f00000\n"),
    TestSvgCase(mode = "transform", arguments = ["scale(2, 3)", "", "", "", ""], expected = "scale 40000000 40400000\nmatrix 40000000 00000000 00000000 40400000 00000000 00000000\n"),
    TestSvgCase(mode = "transform", arguments = ["scale(0.5,-1)", "", "", "", ""], expected = "scale 3f000000 bf800000\nmatrix 3f000000 00000000 80000000 bf800000 00000000 00000000\n"),
    TestSvgCase(mode = "transform", arguments = ["rotate(45)", "", "", "", ""], expected = "rotate 42340000 00000000 00000000\nmatrix 3f3504f3 3f3504f3 bf3504f3 3f3504f3 00000000 00000000\n"),
    TestSvgCase(mode = "transform", arguments = ["rotate(90 50 50)", "", "", "", ""], expected = "rotate 42b40000 42480000 42480000\nmatrix b33bbd2e 3f800000 bf800000 b33bbd2e 42c80000 36800000\n"),
    TestSvgCase(mode = "transform", arguments = ["rotate(30, 10, 20)", "", "", "", ""], expected = "rotate 41f00000 41200000 41a00000\nmatrix 3f5db3d7 3f000000 bf000000 3f5db3d7 41356f9a c0148330\n"),
    TestSvgCase(mode = "transform", arguments = ["skewX(30)", "", "", "", ""], expected = "skewX 41f00000\nmatrix 3f800000 00000000 3f13cd3a 3f800000 00000000 00000000\n"),
    TestSvgCase(mode = "transform", arguments = ["skewY(-15)", "", "", "", ""], expected = "skewY c1700000\nmatrix 3f800000 be8930a3 00000000 3f800000 00000000 00000000\n"),
    TestSvgCase(mode = "transform", arguments = ["matrix(1 0 0 1 10 20)", "", "", "", ""], expected = "matrix 3f800000 00000000 00000000 3f800000 41200000 41a00000\nmatrix 3f800000 00000000 00000000 3f800000 41200000 41a00000\n"),
    TestSvgCase(mode = "transform", arguments = ["matrix(0.5,0.25,-0.25,0.5,3,4)", "", "", "", ""], expected = "matrix 3f000000 3e800000 be800000 3f000000 40400000 40800000\nmatrix 3f000000 3e800000 be800000 3f000000 40400000 40800000\n"),
    TestSvgCase(mode = "transform", arguments = ["  translate ( 1 2 )  ,  rotate(10)", "", "", "", ""], expected = "translate 3f800000 40000000\nrotate 41200000 00000000 00000000\nmatrix 3f7c1c5c 3e31d0d5 be31d0d5 3f7c1c5c 3f800000 40000000\n"),
    TestSvgCase(mode = "transform", arguments = ["translate(1 2)scale(3)", "", "", "", ""], expected = "translate 3f800000 40000000\nscale 40400000 40400000\nmatrix 40400000 00000000 00000000 40400000 3f800000 40000000\n"),
    TestSvgCase(mode = "transform", arguments = ["", "", "", "", ""], expected = "matrix 3f800000 00000000 00000000 3f800000 00000000 00000000\n"),
    TestSvgCase(mode = "transform", arguments = ["foo(1)", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "transform", arguments = ["translate(1", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "transform", arguments = ["matrix(1 2 3)", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "transform", arguments = ["rotate()", "", "", "", ""], expected = "none\n"),
    TestSvgCase(mode = "transform", arguments = ["scale(2) translate(10 10) rotate(45 5 5) skewX(10) skewY(20) matrix(1 0.1 0.2 1 5 6)", "", "", "", ""], expected = "scale 40000000 40000000\ntranslate 41200000 41200000\nrotate 42340000 40a00000 40a00000\nskewX 41200000\nskewY 41a00000\nmatrix 3f800000 3dcccccd 3e4ccccd 3f800000 40a00000 40c00000\nmatrix 3f5fae9b 400be879 bf778044 4004523a 41dfb26b 420fc05f\n"),
    TestSvgCase(mode = "path", arguments = ["M 10 10 L 20 20", "", "", "", ""], expected = "instruction 0 1 41200000 41200000\ninstruction 2 1 41a00000 41a00000\nserialize M 10 10 L 20 20\nverbs ML\npoints 41200000 41200000 41a00000 41a00000\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["M10,10L20,20Z", "", "", "", ""], expected = "instruction 0 1 41200000 41200000\ninstruction 2 1 41a00000 41a00000\ninstruction 1 1\nserialize M 10 10 L 20 20 Z\nverbs MLZM\npoints 41200000 41200000 41a00000 41a00000 41200000 41200000\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["m 10 10 l 5 5 10 -5 z", "", "", "", ""], expected = "instruction 0 0 41200000 41200000\ninstruction 2 0 40a00000 40a00000\ninstruction 2 0 41200000 c0a00000\ninstruction 1 0\nserialize m 10 10 l 5 5 l 10 -5 Z\nverbs MLLZM\npoints 41200000 41200000 41700000 41700000 41c80000 41200000 41200000 41200000\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["M 1 2 3 4 5 6", "", "", "", ""], expected = "instruction 0 1 3f800000 40000000\ninstruction 2 1 40400000 40800000\ninstruction 2 1 40a00000 40c00000\nserialize M 1 2 L 3 4 L 5 6\nverbs MLL\npoints 3f800000 40000000 40400000 40800000 40a00000 40c00000\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["M0 0 H 50 V 30 h -10 v 5 Z", "", "", "", ""], expected = "instruction 0 1 00000000 00000000\ninstruction 3 1 42480000\ninstruction 4 1 41f00000\ninstruction 3 0 c1200000\ninstruction 4 0 40a00000\ninstruction 1 1\nserialize M 0 0 H 50 V 30 h -10 v 5 Z\nverbs MLLLLZM\npoints 00000000 00000000 42480000 00000000 42480000 41f00000 42200000 41f00000 42200000 420c0000 00000000 00000000\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["M 10 80 C 40 10, 65 10, 95 80 S 150 150, 180 80", "", "", "", ""], expected = "instruction 0 1 41200000 42a00000\ninstruction 5 1 42200000 41200000 42820000 41200000 42be0000 42a00000\ninstruction 6 1 43160000 43160000 43340000 42a00000\nserialize M 10 80 C 40 10 65 10 95 80 S 150 150 180 80\nverbs MCC\npoints 41200000 42a00000 42200000 41200000 42820000 41200000 42be0000 42a00000 42fa0000 43160000 43160000 43160000 43340000 42a00000\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["M 10 80 Q 52.5 10, 95 80 T 180 80", "", "", "", ""], expected = "instruction 0 1 41200000 42a00000\ninstruction 7 1 42520000 41200000 42be0000 42a00000\ninstruction 8 1 43340000 42a00000\nserialize M 10 80 Q 52.5 10 95 80 T 180 80\nverbs MQQ\npoints 41200000 42a00000 42520000 41200000 42be0000 42a00000 43098000 43160000 43340000 42a00000\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["m 10 80 q 42.5 -70 85 0 t 85 0 t 30 30", "", "", "", ""], expected = "instruction 0 0 41200000 42a00000\ninstruction 7 0 422a0000 c28c0000 42aa0000 00000000\ninstruction 8 0 42aa0000 00000000\ninstruction 8 0 41f00000 41f00000\nserialize m 10 80 q 42.5 -70 85 0 t 85 0 t 30 30\nverbs MQQQ\npoints 41200000 42a00000 42520000 41200000 42be0000 42a00000 43098000 43160000 43340000 42a00000 435e8000 41200000 43520000 42dc0000\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["M 10 315 L 110 215 A 30 50 0 0 1 162.55 162.45 L 172.55 152.45 A 30 50 -45 0 1 215.1 109.9 L 315 10", "", "", "", ""], expected = "instruction 0 1 41200000 439d8000\ninstruction 2 1 42dc0000 43570000\ninstruction 9 1 41f00000 42480000 00000000 00000000 3f800000 43228ccd 43227333\ninstruction 2 1 432c8ccd 43187333\ninstruction 9 1 41f00000 42480000 c2340000 00000000 3f800000 4357199a 42dbcccd\ninstruction 2 1 439d8000 41200000\nserialize M 10 315 L 110 215 A 30 50 0 0 1 162.55 162.45 L 172.55 152.45 A 30 50 -45 0 1 215.1 109.9 L 315 10\nverbs MLKKLKKL\npoints 41200000 439d8000 42dc0000 43570000 42bc7852 432b3555 42f1051f 4310eeee 4312c8f6 42ed510f 43228ccd 43227333 432c8ccd 43187333 43091777 42e9fbbb 431e5dde 42bf6eee 4333a444 4294e222 4357199a 42dbcccd 439d8000 41200000\nweights 3f3504f2 3f3504f2 3f3504f2 3f3504f2\n"),
    TestSvgCase(mode = "path", arguments = ["M 80 80 A 45 45, 0, 0, 0, 125 125 L 125 80 Z", "", "", "", ""], expected = "instruction 0 1 42a00000 42a00000\ninstruction 9 1 42340000 42340000 00000000 00000000 00000000 42fa0000 42fa0000\ninstruction 2 1 42fa0000 42a00000\ninstruction 1 1\nserialize M 80 80 A 45 45 0 0 0 125 125 L 125 80 Z\nverbs MKLZM\npoints 42a00000 42a00000 42a00000 42fa0000 42fa0000 42fa0000 42fa0000 42a00000 42a00000 42a00000\nweights 3f3504f2\n"),
    TestSvgCase(mode = "path", arguments = ["M 230 80 A 45 45, 0, 1, 0, 275 125 L 275 80 Z", "", "", "", ""], expected = "instruction 0 1 43660000 42a00000\ninstruction 9 1 42340000 42340000 00000000 3f800000 00000000 43898000 42fa0000\ninstruction 2 1 43898000 42a00000\ninstruction 1 1\nserialize M 230 80 A 45 45 0 1 0 275 125 L 275 80 Z\nverbs MKKKLZM\npoints 43660000 42a00000 43390000 42a00000 43390000 42fa0000 43390000 432a0000 43660000 432a0000 43898000 432a0000 43898000 42fa0000 43898000 42a00000 43660000 42a00000\nweights 3f3504f3 3f3504f3 3f3504f3\n"),
    TestSvgCase(mode = "path", arguments = ["M 80 230 a 45 45 0 1 1 45 45 l 0 -45 z", "", "", "", ""], expected = "instruction 0 1 42a00000 43660000\ninstruction 9 0 42340000 42340000 00000000 3f800000 3f800000 42340000 42340000\ninstruction 2 0 00000000 c2340000\ninstruction 1 0\nserialize M 80 230 a 45 45 0 1 1 45 45 l 0 -45 Z\nverbs MKKKLZM\npoints 42a00000 43660000 42a00000 43390000 42fa0000 43390000 432a0000 43390000 432a0000 43660000 432a0000 43898000 42fa0000 43898000 42fa0000 43660000 42a00000 43660000\nweights 3f3504f2 3f3504f2 3f3504f2\n"),
    TestSvgCase(mode = "path", arguments = ["M10 10 a20 20 0 1020 0", "", "", "", ""], expected = "instruction 0 1 41200000 41200000\ninstruction 9 0 41a00000 41a00000 00000000 3f800000 00000000 41a00000 00000000\nserialize M 10 10 a 20 20 0 1 0 20 0\nverbs MKKK\npoints 41200000 41200000 c12a44ba 41af5720 4095bb4c 4220b47e 41a00005 4269bd6d 420d4898 4220b47d 424a912e 41af5717 41f00000 41200000\nweights 3f248dbb 3f248dbb 3f248dbb\n"),
    TestSvgCase(mode = "path", arguments = ["M 10 10 L", "", "", "", ""], expected = "instruction 0 1 41200000 41200000\nserialize M 10 10\nverbs M\npoints 41200000 41200000\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["L 10 10", "", "", "", ""], expected = "serialize \nverbs \npoints\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["M 10 10 X 20 20", "", "", "", ""], expected = "instruction 0 1 41200000 41200000\nserialize M 10 10\nverbs M\npoints 41200000 41200000\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["M 10 10 L 20 20 M 30 30", "", "", "", ""], expected = "instruction 0 1 41200000 41200000\ninstruction 2 1 41a00000 41a00000\ninstruction 0 1 41f00000 41f00000\nserialize M 10 10 L 20 20 M 30 30\nverbs MLM\npoints 41200000 41200000 41a00000 41a00000 41f00000 41f00000\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["M.5.5L1e1-1e1", "", "", "", ""], expected = "instruction 0 1 3f000000 3f000000\ninstruction 2 1 41200000 c1200000\nserialize M 0.5 0.5 L 10 -10\nverbs ML\npoints 3f000000 3f000000 41200000 c1200000\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["m 1 1 c 1 1 2 2 3 3 s 4 4 5 5 c 1 1 2 2 3 3", "", "", "", ""], expected = "instruction 0 0 3f800000 3f800000\ninstruction 5 0 3f800000 3f800000 40000000 40000000 40400000 40400000\ninstruction 6 0 40800000 40800000 40a00000 40a00000\ninstruction 5 0 3f800000 3f800000 40000000 40000000 40400000 40400000\nserialize m 1 1 c 1 1 2 2 3 3 s 4 4 5 5 c 1 1 2 2 3 3\nverbs MCCC\npoints 3f800000 3f800000 40000000 40000000 40400000 40400000 40800000 40800000 40a00000 40a00000 41000000 41000000 41100000 41100000 41200000 41200000 41300000 41300000 41400000 41400000\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["M 0 0 S 10 10 20 0 S 30 -10 40 0", "", "", "", ""], expected = "instruction 0 1 00000000 00000000\ninstruction 6 1 41200000 41200000 41a00000 00000000\ninstruction 6 1 41f00000 c1200000 42200000 00000000\nserialize M 0 0 S 10 10 20 0 S 30 -10 40 0\nverbs MCC\npoints 00000000 00000000 00000000 00000000 41200000 41200000 41a00000 00000000 41f00000 c1200000 41f00000 c1200000 42200000 00000000\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["M 0 0 T 10 10 T 20 0", "", "", "", ""], expected = "instruction 0 1 00000000 00000000\ninstruction 8 1 41200000 41200000\ninstruction 8 1 41a00000 00000000\nserialize M 0 0 T 10 10 T 20 0\nverbs MQQ\npoints 00000000 00000000 00000000 00000000 41200000 41200000 41a00000 41a00000 41a00000 00000000\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["M 0 0 h 10 10 v 5,5", "", "", "", ""], expected = "instruction 0 1 00000000 00000000\ninstruction 3 0 41200000\ninstruction 3 0 41200000\ninstruction 4 0 40a00000\ninstruction 4 0 40a00000\nserialize M 0 0 h 10 h 10 v 5 v 5\nverbs MLLLL\npoints 00000000 00000000 41200000 00000000 41a00000 00000000 41a00000 40a00000 41a00000 41200000\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["", "", "", "", ""], expected = "serialize \nverbs \npoints\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["   ", "", "", "", ""], expected = "serialize \nverbs \npoints\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["M 1 2 z m 3 4 l 1 1", "", "", "", ""], expected = "instruction 0 1 3f800000 40000000\ninstruction 1 0\ninstruction 0 0 40400000 40800000\ninstruction 2 0 3f800000 3f800000\nserialize M 1 2 Z m 3 4 l 1 1\nverbs MZML\npoints 3f800000 40000000 40800000 40c00000 40a00000 40e00000\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["m6 5 13 7-13 7Z", "", "", "", ""], expected = "instruction 0 0 40c00000 40a00000\ninstruction 2 0 41500000 40e00000\ninstruction 2 0 c1500000 40e00000\ninstruction 1 1\nserialize m 6 5 l 13 7 l -13 7 Z\nverbs MLLZM\npoints 40c00000 40a00000 41980000 41400000 40c00000 41980000 40c00000 40a00000\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["M14 5h4v14h-4Zm-4 0H6v14h4z", "", "", "", ""], expected = "instruction 0 1 41600000 40a00000\ninstruction 3 0 40800000\ninstruction 4 0 41600000\ninstruction 3 0 c0800000\ninstruction 1 1\ninstruction 0 0 c0800000 00000000\ninstruction 3 1 40c00000\ninstruction 4 0 41600000\ninstruction 3 0 40800000\ninstruction 1 0\nserialize M 14 5 h 4 v 14 h -4 Z m -4 0 H 6 v 14 h 4 Z\nverbs MLLLZMLLLZM\npoints 41600000 40a00000 41900000 40a00000 41900000 41980000 41600000 41980000 41200000 40a00000 40c00000 40a00000 40c00000 41980000 41200000 41980000 41200000 40a00000\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["M 0 0 L 10 10 ", "", "", "", ""], expected = "instruction 0 1 00000000 00000000\ninstruction 2 1 41200000 41200000\nserialize M 0 0 L 10 10\nverbs ML\npoints 00000000 00000000 41200000 41200000\nweights\n"),
    TestSvgCase(mode = "path", arguments = ["M 0 0 Z ", "", "", "", ""], expected = "instruction 0 1 00000000 00000000\ninstruction 1 1\nserialize M 0 0 Z\nverbs MZM\npoints 00000000 00000000 00000000 00000000\nweights\n"),
    TestSvgCase(mode = "shape", arguments = ["rect", "300", "150", "<svg><rect x=10 y=20 width=100 height=50></rect></svg>", ""], expected = "verbs MLLLLZM\npoints 41200000 41a00000 42dc0000 41a00000 42dc0000 428c0000 41200000 428c0000 41200000 41a00000 41200000 41a00000\nweights\n"),
    TestSvgCase(mode = "shape", arguments = ["rect", "300", "150", "<svg><rect x=10% y=20% width=50% height=25%></rect></svg>", ""], expected = "verbs MLLLLZM\npoints 41f00000 41f00000 43340000 41f00000 43340000 42870000 41f00000 42870000 41f00000 41f00000 41f00000 41f00000\nweights\n"),
    TestSvgCase(mode = "shape", arguments = ["rect", "300", "150", "<svg><rect width=100 height=50 rx=10></rect></svg>", ""], expected = "verbs MLKLKLKLKZM\npoints 41200000 00000000 42b40000 00000000 42c80000 00000000 42c80000 41200000 42c80000 42200000 42c80000 42480000 42b40000 42480000 41200000 42480000 00000000 42480000 00000000 42200000 00000000 41200000 00000000 00000000 41200000 00000000 41200000 00000000\nweights 3f3504f3 3f3504f3 3f3504f5 3f3504f2\n"),
    TestSvgCase(mode = "shape", arguments = ["rect", "300", "150", "<svg><rect width=100 height=50 ry=10></rect></svg>", ""], expected = "verbs MLKLKLKLKZM\npoints 41200000 00000000 42b40000 00000000 42c80000 00000000 42c80000 41200000 42c80000 42200000 42c80000 42480000 42b40000 42480000 41200000 42480000 00000000 42480000 00000000 42200000 00000000 41200000 00000000 00000000 41200000 00000000 41200000 00000000\nweights 3f3504f3 3f3504f3 3f3504f5 3f3504f2\n"),
    TestSvgCase(mode = "shape", arguments = ["rect", "300", "150", "<svg><rect width=100 height=50 rx=80 ry=5></rect></svg>", ""], expected = "verbs MLKLKLKLKZM\npoints 42480000 00000000 42480000 00000000 42c80000 00000000 42c80000 40a00000 42c80000 42340000 42c80000 42480000 42480000 42480000 42480000 42480000 00000000 42480000 00000000 42340000 00000000 40a00000 00000000 00000000 42480000 00000000 42480000 00000000\nweights 3f3504f3 3f3504f3 3f3504f5 3f3504f2\n"),
    TestSvgCase(mode = "shape", arguments = ["rect", "300", "150", "<svg><rect width=100 height=50 rx=10% ry=20%></rect></svg>", ""], expected = "verbs MLKLKLKLKZM\npoints 41f00000 00000000 428c0000 00000000 42c80000 00000000 42c80000 41c80000 42c80000 41c80000 42c80000 42480000 428c0000 42480000 41f00000 42480000 00000000 42480000 00000000 41c80000 00000000 41c80000 00000000 00000000 41f00000 00000000 41f00000 00000000\nweights 3f3504f3 3f3504f3 3f3504f5 3f3504f2\n"),
    TestSvgCase(mode = "shape", arguments = ["rect", "300", "150", "<svg><rect width=0 height=50></rect></svg>", ""], expected = "verbs \npoints\nweights\n"),
    TestSvgCase(mode = "shape", arguments = ["rect", "300", "150", "<svg><rect width=100 height=bogus></rect></svg>", ""], expected = "verbs \npoints\nweights\n"),
    TestSvgCase(mode = "shape", arguments = ["ellipse", "300", "150", "<svg><ellipse cx=50 cy=40 rx=30 ry=20></ellipse></svg>", ""], expected = "verbs MKKKK\npoints 42a00000 42200000 42a00000 42700000 42480000 42700000 41a00000 42700000 41a00000 42200000 41a00000 41a00000 42480000 41a00000 42a00000 41a00000 42a00000 42200000\nweights 3f3504f3 3f3504f5 3f3504f2 3f3504f3\n"),
    TestSvgCase(mode = "shape", arguments = ["ellipse", "300", "150", "<svg><ellipse cx=50 cy=40 rx=-30 ry=20></ellipse></svg>", ""], expected = "verbs \npoints\nweights\n"),
    TestSvgCase(mode = "shape", arguments = ["ellipse", "300", "150", "<svg><ellipse rx=10 ry=10></ellipse></svg>", ""], expected = "verbs MKKKK\npoints 41200000 00000000 41200000 41200000 00000000 41200000 c1200000 41200000 c1200000 00000000 c1200000 c1200000 00000000 c1200000 41200000 c1200000 41200000 00000000\nweights 3f3504f3 3f3504f5 3f3504f2 3f3504f3\n"),
    TestSvgCase(mode = "shape", arguments = ["line", "300", "150", "<svg><line x1=10 y1=20 x2=30% y2=50%></line></svg>", ""], expected = "verbs ML\npoints 41200000 41a00000 42b40000 42960000\nweights\n"),
    TestSvgCase(mode = "shape", arguments = ["line", "300", "150", "<svg><line></line></svg>", ""], expected = "verbs ML\npoints 00000000 00000000 00000000 00000000\nweights\n"),
    TestSvgCase(mode = "shape", arguments = ["polygon", "300", "150", "<svg><polygon points=\"0,0 10,0 10,10\"></polygon></svg>", ""], expected = "verbs MLLZM\npoints 00000000 00000000 41200000 00000000 41200000 41200000 00000000 00000000\nweights\n"),
    TestSvgCase(mode = "shape", arguments = ["polygon", "300", "150", "<svg><polygon points=\"\"></polygon></svg>", ""], expected = "verbs \npoints\nweights\n"),
    TestSvgCase(mode = "shape", arguments = ["polyline", "300", "150", "<svg><polyline points=\"0,0 10,0 10,10 20,20\"></polyline></svg>", ""], expected = "verbs MLLL\npoints 00000000 00000000 41200000 00000000 41200000 41200000 41a00000 41a00000\nweights\n"),
    TestSvgCase(mode = "shape", arguments = ["path", "300", "150", "<svg><path d=\"M 10 10 h 20 v 20 h -20 z\"></path></svg>", ""], expected = "verbs MLLLZM\npoints 41200000 41200000 41f00000 41200000 41f00000 41f00000 41200000 41f00000 41200000 41200000\nweights\n"),
    TestSvgCase(mode = "shape", arguments = ["path", "300", "150", "<svg><path d=\"M 80 80 A 45 45, 0, 0, 0, 125 125 L 125 80 Z\"></path></svg>", ""], expected = "verbs MKLZM\npoints 42a00000 42a00000 42a00000 42fa0000 42fa0000 42fa0000 42fa0000 42a00000 42a00000 42a00000\nweights 3f3504f2\n"),
    TestSvgCase(mode = "shape", arguments = ["path", "300", "150", "<svg><path d=\"L 10 10\"></path></svg>", ""], expected = "verbs \npoints\nweights\n"),
    TestSvgCase(mode = "svgroot", arguments = ["<svg width=200 height=100 viewBox=\"0 0 20 10\" preserveAspectRatio=\"xMinYMax slice\"></svg>", "", "", "", ""], expected = "viewbox 0000000000000000 0000000000000000 4034000000000000 4024000000000000\npar 7 1\nactive 0000000000000000 0000000000000000 4034000000000000 4024000000000000\nnulled 0\nwidth 200px\nheight 100px\nnatural 12800 6400 12800/6400\n"),
    TestSvgCase(mode = "svgroot", arguments = ["<svg></svg>", "", "", "", ""], expected = "viewbox none\npar none\nactive none\nnulled 1\nwidth none\nheight none\nnatural none none none\n"),
    TestSvgCase(mode = "svgroot", arguments = ["<svg width=50% height=10em></svg>", "", "", "", ""], expected = "viewbox none\npar none\nactive none\nnulled 1\nwidth 50%\nheight 10em\nnatural none none none\n"),
    TestSvgCase(mode = "svgroot", arguments = ["<svg width=\"\" height=\"\"></svg>", "", "", "", ""], expected = "viewbox none\npar none\nactive none\nnulled 1\nwidth 100%\nheight 100%\nnatural none none none\n"),
    TestSvgCase(mode = "svgroot", arguments = ["<svg viewBox=\"0 0 300 150\"></svg>", "", "", "", ""], expected = "viewbox 0000000000000000 0000000000000000 4072c00000000000 4062c00000000000\npar none\nactive 0000000000000000 0000000000000000 4072c00000000000 4062c00000000000\nnulled 0\nwidth none\nheight none\nnatural none none 19200/9600\n"),
    TestSvgCase(mode = "svgroot", arguments = ["<svg viewBox=\"bad\"></svg>", "", "", "", ""], expected = "viewbox none\npar none\nactive none\nnulled 1\nwidth none\nheight none\nnatural none none none\n"),
    TestSvgCase(mode = "svgroot", arguments = ["<svg width=2in height=1cm></svg>", "", "", "", ""], expected = "viewbox none\npar none\nactive none\nnulled 1\nwidth 2in\nheight 1cm\nnatural 12288 2419 12288/2419\n"),
    TestSvgCase(mode = "svgroot", arguments = ["<svg width=0 height=100 viewBox=\"0 0 30 20\"></svg>", "", "", "", ""], expected = "viewbox 0000000000000000 0000000000000000 403e000000000000 4034000000000000\npar none\nactive 0000000000000000 0000000000000000 403e000000000000 4034000000000000\nnulled 0\nwidth 0px\nheight 100px\nnatural 0 6400 none\n"),
    TestSvgCase(mode = "svgroot", arguments = ["<svg width=100 viewBox=\"0 0 30 20\"></svg>", "", "", "", ""], expected = "viewbox 0000000000000000 0000000000000000 403e000000000000 4034000000000000\npar none\nactive 0000000000000000 0000000000000000 403e000000000000 4034000000000000\nnulled 0\nwidth 100px\nheight none\nnatural 6400 none 1920/1280\n"),
    TestSvgCase(mode = "xform", arguments = ["g", "<svg><g transform=\"translate(10 20) rotate(30)\"></g></svg>", "", "", ""], expected = "matrix 3f5db3d7 3f000000 bf000000 3f5db3d7 41200000 41a00000\n"),
    TestSvgCase(mode = "xform", arguments = ["rect", "<svg><rect transform=\"scale(2) skewX(15)\"></rect></svg>", "", "", ""], expected = "matrix 40000000 00000000 3f0930a3 40000000 00000000 00000000\n"),
    TestSvgCase(mode = "xform", arguments = ["g", "<svg><g></g></svg>", "", "", ""], expected = "matrix 3f800000 00000000 00000000 3f800000 00000000 00000000\n"),
    TestSvgCase(mode = "xform", arguments = ["g", "<svg><g transform=\"bogus\"></g></svg>", "", "", ""], expected = "matrix 3f800000 00000000 00000000 3f800000 00000000 00000000\n"),
    TestSvgCase(mode = "xform", arguments = ["svg", "<svg transform=\"matrix(2 0 0 2 1 1)\"></svg>", "", "", ""], expected = "matrix 40000000 00000000 00000000 40000000 3f800000 3f800000\n"),
    TestSvgCase(mode = "hints", arguments = ["rect", "<svg><rect x=10 y=5 width=100 height=50 fill=red stroke=blue stroke-width=3 rx=4 data-x=1></rect></svg>", "", "", ""], expected = "hint x 1\nhint y 1\nhint width 1\nhint height 1\nhint fill 1\nhint stroke 1\nhint stroke-width 1\nhint rx 1\nhint data-x 0\nx: 10px\ny: 5px\nwidth: 100px\nheight: 50px\nfill: red\nstroke: blue\nstroke-width: 3\nrx: 4px\n"),
    TestSvgCase(mode = "hints", arguments = ["circle", "<svg><circle cx=10 cy=20 r=5 fill-opacity=0.5 opacity=.25></circle></svg>", "", "", ""], expected = "hint cx 1\nhint cy 1\nhint r 1\nhint fill-opacity 1\nhint opacity 1\ncx: 10px\ncy: 20px\nfill-opacity: 0.5\nopacity: 0.25\ncx: 10px\ncy: 20px\nr: 5px\n"),
    TestSvgCase(mode = "hints", arguments = ["ellipse", "<svg><ellipse cx=1 cy=2 rx=3 ry=4 width=10></ellipse></svg>", "", "", ""], expected = "hint cx 1\nhint cy 1\nhint rx 1\nhint ry 1\nhint width 1\ncx: 1px\ncy: 2px\nrx: 3px\nry: 4px\n"),
    TestSvgCase(mode = "hints", arguments = ["svg", "<svg width=200 height=100 x=5 display=none font-stretch=condensed></svg>", "", "", ""], expected = "hint width 1\nhint height 1\nhint x 1\nhint display 1\nhint font-stretch 1\nwidth: 200px\nheight: 100px\nx: 5px\ndisplay: none\nfont-width: condensed\n"),
    TestSvgCase(mode = "hints", arguments = ["g", "<svg><g transform=\"rotate(10)\" fill=\"url(#x)\" visibility=hidden FILL=green></g></svg>", "", "", ""], expected = "hint transform 0\nhint fill 1\nhint visibility 1\nfill: url(\"#x\")\nvisibility: hidden\n"),
    TestSvgCase(mode = "hints", arguments = ["g", "<svg><g circle=7 r=3 cx=1></g></svg>", "", "", ""], expected = "hint circle 1\nhint r 0\nhint cx 1\nr: 7px\n"),
    TestSvgCase(mode = "hints", arguments = ["path", "<svg><path d=\"M0 0\" stroke-dasharray=\"1 2\" stroke-linecap=round stroke-linejoin=bevel fill-rule=evenodd mask=url(#m) clip-path=url(#c)></path></svg>", "", "", ""], expected = "hint d 0\nhint stroke-dasharray 1\nhint stroke-linecap 1\nhint stroke-linejoin 1\nhint fill-rule 1\nhint mask 1\nhint clip-path 1\nstroke-dasharray: 1, 2\nstroke-linecap: round\nstroke-linejoin: bevel\nfill-rule: evenodd\nmask: url(\"#m\")\nclip-path: url(\"#c\")\n"),
    TestSvgCase(mode = "role", arguments = ["g", "<svg><g></g></svg>", "", "", ""], expected = "26\n"),
    TestSvgCase(mode = "role", arguments = ["circle", "<svg><circle aria-label=\"dot\"></circle></svg>", "", "", ""], expected = "29\n"),
    TestSvgCase(mode = "role", arguments = ["path", "<svg><path><desc>d</desc></path></svg>", "", "", ""], expected = "29\n"),
    TestSvgCase(mode = "role", arguments = ["rect", "<svg><rect><desc>r</desc></rect></svg>", "", "", ""], expected = "26\n"),
    TestSvgCase(mode = "role", arguments = ["svg", "<svg></svg>", "", "", ""], expected = "26\n"),
    TestSvgCase(mode = "role", arguments = ["polygon", "<svg><polygon role=presentation aria-labelledby=\" \"></polygon></svg>", "", "", ""], expected = "26\n"),
    TestSvgCase(mode = "lengths", arguments = ["rect", "<svg><rect x=10 y=20% width=30 height=40 rx=5></rect></svg>", "", "", ""], expected = "x 41200000 0 41200000\ny 3e4ccccd 0 3e4ccccd\nwidth 41f00000 0 41f00000\nheight 42200000 0 42200000\nrx 40a00000 0 40a00000\nry 00000000 0 00000000\n"),
    TestSvgCase(mode = "lengths", arguments = ["ellipse", "<svg><ellipse cx=1.5 cy=-2 rx=3 ry=-4></ellipse></svg>", "", "", ""], expected = "cx 3fc00000 0 3fc00000\ncy c0000000 0 c0000000\nrx 40400000 0 40400000\nry 00000000 0 00000000\n"),
    TestSvgCase(mode = "lengths", arguments = ["line", "<svg><line x1=1 y1=50% x2=bogus></line></svg>", "", "", ""], expected = "x1 3f800000 0 3f800000\ny1 3f000000 0 3f000000\nx2 00000000 0 00000000\ny2 00000000 0 00000000\n"),
    TestSvgCase(mode = "href", arguments = ["<svg class=\"a b\"><script href=\"h.js\" xlink:href=\"x.js\"></script></svg>", "", "", "", ""], expected = "href h.js\nclass a b\n"),
    TestSvgCase(mode = "href", arguments = ["<svg><script xlink:href=\"x.js\"></script></svg>", "", "", "", ""], expected = "href x.js\nclass \n"),
    TestSvgCase(mode = "href", arguments = ["<svg><script></script></svg>", "", "", "", ""], expected = "href \nclass \n"),
    TestSvgCase(mode = "ctf", arguments = ["type=identity", "", "", "", ""], expected = "type 1\ntable\nnumbers 3f800000 00000000 3f800000 3f800000 00000000\ncolors000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff\n"),
    TestSvgCase(mode = "ctf", arguments = ["type=table", "tableValues=0 0.5 1", "", "", ""], expected = "type 2\ntable 00000000 3f000000 3f800000\nnumbers 3f800000 00000000 3f800000 3f800000 00000000\ncolors000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff\n"),
    TestSvgCase(mode = "ctf", arguments = ["type=table", "tableValues=1", "", "", ""], expected = "type 2\ntable 3f800000\nnumbers 3f800000 00000000 3f800000 3f800000 00000000\ncolorsffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\n"),
    TestSvgCase(mode = "ctf", arguments = ["type=table", "tableValues=", "", "", ""], expected = "type 2\ntable\nnumbers 3f800000 00000000 3f800000 3f800000 00000000\ncolors000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff\n"),
    TestSvgCase(mode = "ctf", arguments = ["type=discrete", "tableValues=0 0.25 0.5 1", "", "", ""], expected = "type 3\ntable 00000000 3e800000 3f000000 3f800000\nnumbers 3f800000 00000000 3f800000 3f800000 00000000\ncolors000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\n"),
    TestSvgCase(mode = "ctf", arguments = ["type=linear", "slope=0.5", "intercept=0.25", "", ""], expected = "type 4\ntable\nnumbers 3f000000 3e800000 3f800000 3f800000 00000000\ncolors40404141424243434444454546464747484849494a4a4b4b4c4c4d4d4e4e4f4f50505151525253535454555556565757585859595a5a5b5b5c5c5d5d5e5e5f5f60606161626263636464656566666767686869696a6a6b6b6c6c6d6d6e6e6f6f70707171727273737474757576767777787879797a7a7b7b7c7c7d7d7e7e7f7f80808181828283838484858586868787888889898a8a8b8b8c8c8d8d8e8e8f8f90909191929293939494959596969797989899999a9a9b9b9c9c9d9d9e9e9f9fa0a0a1a1a2a2a3a3a4a4a5a5a6a6a7a7a8a8a9a9aaaaababacacadadaeaeafafb0b0b1b1b2b2b3b3b4b4b5b5b6b6b7b7b8b8b9b9bababbbbbcbcbdbdbebebfbf\n"),
    TestSvgCase(mode = "ctf", arguments = ["type=linear", "", "", "", ""], expected = "type 4\ntable\nnumbers 3f800000 00000000 3f800000 3f800000 00000000\ncolors000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff\n"),
    TestSvgCase(mode = "ctf", arguments = ["type=gamma", "amplitude=2", "exponent=0.5", "offset=-0.1", ""], expected = "type 5\ntable\nnumbers 3f800000 00000000 40000000 3f000000 bdcccccd\ncolors0006141e262e353b41464b50555a5e62666a6e7275797c808386898c8f9295989b9ea1a3a6a9abaeb0b3b5b8babdbfc1c4c6c8cbcdcfd1d3d5d8dadcdee0e2e4e6e8eaeceef0f2f4f5f7f9fbfdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\n"),
    TestSvgCase(mode = "ctf", arguments = ["type=gamma", "", "", "", ""], expected = "type 5\ntable\nnumbers 3f800000 00000000 3f800000 3f800000 00000000\ncolors000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff\n"),
    TestSvgCase(mode = "ctf", arguments = ["type=bogus", "", "", "", ""], expected = "type 0\ntable\nnumbers 3f800000 00000000 3f800000 3f800000 00000000\ncolors000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff\n"),
    TestSvgCase(mode = "ctf", arguments = ["slope=abc", "intercept=10%", "", "", ""], expected = "type 0\ntable\nnumbers 3f800000 3dcccccd 3f800000 3f800000 00000000\ncolors000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff\n"),
    TestSvgCase(mode = "animnum", arguments = ["3.5", "0", "first", "", ""], expected = "base 40600000\nattribute 7.5\n"),
    TestSvgCase(mode = "animnum", arguments = ["-", "0", "first", "", ""], expected = "base 40000000\nattribute 7.5\n"),
    TestSvgCase(mode = "animnum", arguments = ["abc", "0", "first", "", ""], expected = "base 40000000\nattribute 7.5\n"),
    TestSvgCase(mode = "animnum", arguments = ["1 2", "1", "first", "", ""], expected = "base 3f800000\nattribute 7.5 2\n"),
    TestSvgCase(mode = "animnum", arguments = ["1 2", "1", "second", "", ""], expected = "base 40000000\nattribute 1 7.5\n"),
    TestSvgCase(mode = "animnum", arguments = ["4", "1", "second", "", ""], expected = "base 40800000\nattribute 4 7.5\n"),
    TestSvgCase(mode = "animnum", arguments = ["-", "1", "second", "", ""], expected = "base 40000000\nattribute 2 7.5\n"),
    TestSvgCase(mode = "animnum", arguments = ["1  2", "1", "second", "", ""], expected = "base 40000000\nattribute 1 7.5\n"),
    TestSvgCase(mode = "animint", arguments = ["12", "0", "first", "", ""], expected = "base 12\nattribute 7\n"),
    TestSvgCase(mode = "animint", arguments = ["3 4", "1", "second", "", ""], expected = "base 4\nattribute 3 7\n"),
    TestSvgCase(mode = "animint", arguments = ["3", "1", "second", "", ""], expected = "base 3\nattribute 3 7\n"),
    TestSvgCase(mode = "animint", arguments = ["x", "0", "first", "", ""], expected = "base 2\nattribute 7\n"),
]