 
 test "bug_not_list_argument_if_nothing_matched", ->
     d = 'usage: prog [NAME [NAME ...]]'
-#    eq docopt(d, 'a b'), {'NAME': ['a', 'b']}
-#    eq docopt(d, ''), {'NAME': []}
+    eq(
+        docopt(
+            d
+            argv: 'a b'
+        )
+        new Dict [
+            ['NAME', ['a', 'b']]
+        ]
+    )
+    eq(
+        docopt(
+            d
+            argv: ' '
+        )
+        new Dict [
+            ['NAME', []]
+        ]
+    )
 
 
 test "option_arguments_default_to_none", ->



test "pattern_fix_identities_1", ->
    pattern = new Required([new Argument('N'), new Argument('N')])
    eq pattern.children[0], pattern.children[1]
    #pattern.children[0] isnt pattern.children[1]
    #pattern.fix_identities()

`with (require('./docopt')) { //`

test "Option.parse", ->
    eq(
        Option.parse('-h')
        new Option('-h', null)
    )
    eq(
        Option.parse('-h')
        new Option('-h', null)
    )
    eq(
        Option.parse '--help'
        new Option null, '--help'
    )
    eq(
        Option.parse '-h --help'
        new Option '-h', '--help'
    )
    eq(
        Option.parse '-h, --help'
        new Option '-h', '--help'
    )
    
    eq(
        Option.parse '-h TOPIC'
        new Option '-h', null, 1
    )
    eq(
        Option.parse '--help TOPIC'
        new Option null, '--help', 1
    )
    eq(
        Option.parse '-h TOPIC --help TOPIC'
        new Option '-h', '--help', 1
    )
    eq(
        Option.parse '-h TOPIC, --help TOPIC'
        new Option '-h', '--help', 1
    )
    eq(
        Option.parse '-h TOPIC, --help=TOPIC'
        new Option '-h', '--help', 1
    )
    
    eq(
        Option.parse '-h  Description...'
        new Option '-h', null
    )
    eq(
        Option.parse '-h --help  Description...'
        new Option '-h', '--help'
    )
    eq(
        Option.parse '-h TOPIC  Description...'
        new Option '-h', null, 1
    )

    eq(
        Option.parse '    -h'
        new Option '-h', null
    )

    eq(
        Option.parse '-h TOPIC  Descripton... [default: 2]'
        new Option '-h', null, 1, '2'
    )
    eq(
        Option.parse '-h TOPIC  Descripton... [default: topic-1]'
        new Option '-h', null, 1, 'topic-1'
    )
    eq(
        Option.parse '--help=TOPIC  ... [default: 3.14]'
        new Option null, '--help', 1, '3.14'
    )
    eq(
        Option.parse '-h, --help=DIR  ... [default: ./]'
        new Option '-h', '--help', 1, "./"
    )
    
test "TokenStream", ->
    eq new TokenStream(['-o', 'arg']), ['-o', 'arg']
