--- /dev/null
+#!perl -T
+
+use strict;
+use warnings;
+
+use Test::More tests => 5 + 2 * 4;
+
+use LaTeX::TikZ;
+use LaTeX::TikZ::Formatter;
+
+my $tikz = LaTeX::TikZ::Formatter->new(
+ format => '%d',
+);
+
+sub check {
+ my ($set, $desc, $exp) = @_;
+
+ my ($head, $decl, $body) = eval {
+ $tikz->render(ref $set eq 'ARRAY' ? @$set : $set);
+ };
+ is $@, '', "$desc: no error";
+
+ unless (ref $exp eq 'ARRAY') {
+ $exp = [ split /\n/, $exp ];
+ }
+ unshift @$exp, '\begin{tikzpicture}';
+ push @$exp, '\end{tikzpicture}';
+
+ is_deeply $body, $exp, $desc;
+}
+
+my $foo = eval {
+ Tikz->raw('foo');
+};
+is $@, '', 'creating a raw set doesn\'t croak';
+
+check $foo, 'one raw set', <<'RES';
+\draw foo ;
+RES
+
+my $seq2 = eval {
+ Tikz->seq($foo, $foo);
+};
+is $@, '', 'creating a 2-sequence doesn\'t croak';
+
+check $seq2, 'two identical raw sets', <<'RES';
+\draw foo ;
+\draw foo ;
+RES
+
+my $bar = eval {
+ Tikz->raw('bar');
+};
+is $@, '', 'creating another raw set doesn\'t croak';
+
+$seq2 = eval {
+ Tikz->seq($foo, $bar);
+};
+is $@, '', 'creating another 2-sequence doesn\'t croak';
+
+check $seq2, 'two different raw sets', <<'RES';
+\draw foo ;
+\draw bar ;
+RES
+
+my $seq3 = eval {
+ Tikz->seq($bar, $seq2, $foo);
+};
+is $@, '', 'creating a complex sequence doesn\'t croak';
+
+check $seq3, 'two different raw sets and a sequence', <<'RES';
+\draw bar ;
+\draw foo ;
+\draw bar ;
+\draw foo ;
+RES