diff --git a/lib/HTML/Tag.pm6 b/lib/HTML/Tag.pm6
index 62dd0f1..4bde460 100644
--- a/lib/HTML/Tag.pm6
+++ b/lib/HTML/Tag.pm6
@@ -12,7 +12,8 @@ class HTML::Tag
method mktag(:$prefix, :$suffix = '>') {
my $tag;
$tag = $prefix if $prefix;
- $.attr.keys.map: { when 'checked' { $tag ~= ' checked' }
+ $.attr.keys.sort.map: {
+ when 'checked' { $tag ~= ' checked' }
when 'disabled' { $tag ~= ' disabled' }
when 'readonly' { $tag ~= ' readonly' }
when 'required' { $tag ~= ' required' }
diff --git a/t/0010-html.t b/t/0010-html.t
index 69a6fd1..78e14d0 100644
--- a/t/0010-html.t
+++ b/t/0010-html.t
@@ -13,13 +13,13 @@ use HTML::Tag::Macro;
is HTML::Tag::p.new(:text('testing & here')).render, '
My Span', 'HTML::Tag::span works';
# Form
-is HTML::Tag::form.new(:action('/myscript/is') :id('myid')).render, '
', 'HTML::Tag::form works';
+is HTML::Tag::form.new(:action('/myscript/is') :id('myid')).render, '
', 'HTML::Tag::form works';
is HTML::Tag::input.new(:value('testval'), :min(0)).render, '
', 'HTML::Tag::input works';
is HTML::Tag::input.new(:type('radio'), :checked(True)).render, '
', 'HTML::Tag::input radio checked works';
is HTML::Tag::textarea.new(:text('This is in the box'), :id('boxy')).render, '
', 'HTML::Tag::textarea works';
@@ -56,13 +56,13 @@ is HTML::Tag::fieldset.new(:form('myform'), :text($legend, $tag)).render, '
', 'HTML::Tag::Macro:CSS works';
+'', 'HTML::Tag::Macro:CSS works';
# Image
is HTML::Tag::img.new(:src('/img/foo.jpg'),
:width(100), :height(150),
:alt('funny pic'),
- :border(0)).render, '
', 'HTML::Tag::img works.';
+ :border(0)).render, '
', 'HTML::Tag::img works.';
# Table
my $th1 = HTML::Tag::th.new(:text('Col1'));
diff --git a/t/0020-form.t b/t/0020-form.t
index c9878b9..94df478 100644
--- a/t/0020-form.t
+++ b/t/0020-form.t
@@ -19,7 +19,7 @@ my @def = ( { username => { }},
$form.def = @def;
-is $form.render, '', 'HTML::Tag::Macro::Form minimal def';
+is $form.render, '', 'HTML::Tag::Macro::Form minimal def';
@def = ( { username => { autofocus => True }},
{ password => { }},
@@ -29,11 +29,11 @@ is $form.render, '', 'HTML::Tag::Macro::Form autofocus';
+is $form.render, '', 'HTML::Tag::Macro::Form autofocus';
ok $form = HTML::Tag::Macro::Form.new(:def(@def), :action('/')), 'HTML::Tag::Macro::Form def passed directly in';
-is $form.render, '', 'HTML::Tag::Macro::Form with labels';
+is $form.render, '', 'HTML::Tag::Macro::Form with labels';
@def = ( { username => { }},
{ password => { }},
@@ -44,14 +44,14 @@ is $form.render, '', 'HTML::Tag::Macro::Form with labels excluding one';
+is $form.render, '', 'HTML::Tag::Macro::Form with labels excluding one';
my %input;
%input = 'mark';
ok $form = HTML::Tag::Macro::Form.new(:nolabel, :input(%input), :def(@def), :action('/')), 'HTML::Tag::Macro::Form input values instatiate';
-is $form.render, '', 'HTML::Tag::Macro::Form with value test';
+is $form.render, '', 'HTML::Tag::Macro::Form with value test';
@def = ( { username => { }},
{ password => { type => 'password' }},
@@ -65,7 +65,7 @@ is $form.render, '', 'HTML::Tag::Macro::Form with value test password types set no values';
+is $form.render, '', 'HTML::Tag::Macro::Form with value test password types set no values';
my $tag-after = HTML::Tag::br.new;
my $tag-before = HTML::Tag::span.new(:text('oofie'));
@@ -80,7 +80,7 @@ my $tag-before = HTML::Tag::span.new(:text('oofie'));
ok $form = HTML::Tag::Macro::Form.new(:input(%input), :def(@def), :action('/')), 'HTML::Tag::Macro::Form input values instatiate for tags before/after';
-is $form.render, '', 'HTML::Tag::Macro::Form testing before/after tags';
+is $form.render, '', 'HTML::Tag::Macro::Form testing before/after tags';
@def = ( { username => { swallowed-by => $tag-before }},
{ password => { type => 'password' }},
@@ -91,7 +91,7 @@ is $form.render, '', 'HTML::Tag::Macro::Form input swallowing';
+is $form.render, '', 'HTML::Tag::Macro::Form input swallowing';
ok $form = HTML::Tag::Macro::Form.new(:nolabel, :action('/')), 'HTML::Tag::Macro::Form for required test instantated';
@@ -104,7 +104,7 @@ ok $form = HTML::Tag::Macro::Form.new(:nolabel, :action('/')), 'HTML::Tag::Macro
$form.def = @def;
-is $form.render, '', 'HTML::Tag::Macro::Form required fields';
+is $form.render, '', 'HTML::Tag::Macro::Form required fields';
$form = HTML::Tag::Macro::Form.new(:nolabel, :action('/'));
@@ -116,7 +116,7 @@ $form = HTML::Tag::Macro::Form.new(:nolabel, :action('/'));
$form.def = @def;
-is $form.render, '', 'HTML::Tag::Macro::Form using individual/normal tag attrs';
+is $form.render, '', 'HTML::Tag::Macro::Form using individual/normal tag attrs';
$form = HTML::Tag::Macro::Form.new(:nolabel, :action('/'));
@@ -129,7 +129,7 @@ $form = HTML::Tag::Macro::Form.new(:nolabel, :action('/'));
$form.def = @def;
-is $form.render, '', 'HTML::Tag::Macro::Form empty textarea';
+is $form.render, '', 'HTML::Tag::Macro::Form empty textarea';
$form = HTML::Tag::Macro::Form.new(:nolabel, :action('/'));
@@ -143,7 +143,7 @@ $form = HTML::Tag::Macro::Form.new(:nolabel, :action('/'));
$form.def = @def;
-is $form.render, '', 'HTML::Tag::Macro::Form textarea with text';
+is $form.render, '', 'HTML::Tag::Macro::Form textarea with text';
%input = notes => 'do not forget';
@@ -159,7 +159,7 @@ $form = HTML::Tag::Macro::Form.new(:nolabel, :input(%input), :action('/'));
$form.def = @def;
-is $form.render, '', 'HTML::Tag::Macro::Form textarea with text overrides value';
+is $form.render, '', 'HTML::Tag::Macro::Form textarea with text overrides value';
%input = notes => 'do not forget';
@@ -174,5 +174,5 @@ $form = HTML::Tag::Macro::Form.new(:nolabel, :input(%input), :action('/'));
$form.def = @def;
-is $form.render, '', 'HTML::Tag::Macro::Form textarea values work';
+is $form.render, '', 'HTML::Tag::Macro::Form textarea values work';
diff --git a/t/0040-table.t b/t/0040-table.t
index c32ca3f..d7ddf91 100644
--- a/t/0040-table.t
+++ b/t/0040-table.t
@@ -37,7 +37,7 @@ my $td-opts = %(1 => {class => 'pretty'},
2 => {class => 'pretty',
id => 'lastone'});
$table.row(:td-opts($td-opts), @data);
-is $table.render, '| Col1 | Col2 | Col3 |
|---|
| 11 | 22 | 33 |
| 111 | 222 | 333 |
', 'HTML::Tag::Macro::Table works with td-opts';
+is $table.render, '| Col1 | Col2 | Col3 |
|---|
| 11 | 22 | 33 |
| 111 | 222 | 333 |
', 'HTML::Tag::Macro::Table works with td-opts';
$table = HTML::Tag::Macro::Table.new(:table-opts(id => 'mytable'));
@data = 'Col1', 'Col2', 'Col3';