zuzu-rust 0.4.0

Rust implementation of ZuzuScript
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from test/more import *;
from std/colour import parse_colour;

is( parse_colour("#336699"), "#336699", "six-digit hex passes through" );
is( parse_colour("#ABC"), "#aabbcc", "three-digit hex expands" );
is( parse_colour("red"), "#ff0000", "basic keyword parses" );
is( parse_colour("LightGrey"), "#d3d3d3", "keywords are case-insensitive" );
is( parse_colour("darkslategray"), "#2f4f4f", "gray variant parses" );
is( parse_colour("darkslategrey"), "#2f4f4f", "grey variant parses" );

let bad := exception( function () {
	parse_colour("not-a-colour");
} );
ok( bad instanceof Exception, "invalid colour throws" );

done_testing();