ported fixes from Mojolicious
[catagits/DOM-Tiny.git] / t / dom.t
diff --git a/t/dom.t b/t/dom.t
index 0a55239..e7ad2ec 100644 (file)
--- a/t/dom.t
+++ b/t/dom.t
@@ -2214,8 +2214,13 @@ $dom = DOM::Tiny->new(<<EOF);
 <form action="/foo">
   <p>Test</p>
   <input type="text" name="a" value="A" />
+  <input type="checkbox" name="q">
   <input type="checkbox" checked name="b" value="B">
+  <input type="radio" name="r">
   <input type="radio" checked name="c" value="C">
+  <input name="s">
+  <input type="checkbox" name="t" value="">
+  <input type=text name="u">
   <select multiple name="f">
     <option value="F">G</option>
     <optgroup>
@@ -2251,6 +2256,11 @@ is_deeply $dom->find('select')->last->at('option')->val, 'R', 'right value';
 is $dom->at('textarea')->val, 'M', 'right value';
 is $dom->at('button')->val,   'O', 'right value';
 is $dom->find('form input')->last->val, 'P', 'right value';
+is $dom->at('input[name=q]')->val, 'on',  'right value';
+is $dom->at('input[name=r]')->val, 'on',  'right value';
+is $dom->at('input[name=s]')->val, undef, 'no value';
+is $dom->at('input[name=t]')->val, '',    'right value';
+is $dom->at('input[name=u]')->val, undef, 'no value';
 
 # PoCo example with whitespace sensitive text
 $dom = DOM::Tiny->new(<<EOF);