2018-12-19 13:06:31 -05:00
|
|
|
import { test, assertEqual } from "https://deno.land/x/testing/testing.ts";
|
2018-12-21 13:02:52 -05:00
|
|
|
import { parse } from "../index.ts";
|
2018-12-19 13:06:31 -05:00
|
|
|
|
|
|
|
test(function longOpts() {
|
|
|
|
assertEqual(
|
2018-12-21 13:02:52 -05:00
|
|
|
parse([ '--bool' ]),
|
2018-12-19 13:06:31 -05:00
|
|
|
{ bool : true, _ : [] },
|
|
|
|
);
|
|
|
|
assertEqual(
|
2018-12-21 13:02:52 -05:00
|
|
|
parse([ '--pow', 'xixxle' ]),
|
2018-12-19 13:06:31 -05:00
|
|
|
{ pow : 'xixxle', _ : [] },
|
|
|
|
);
|
|
|
|
assertEqual(
|
2018-12-21 13:02:52 -05:00
|
|
|
parse([ '--pow=xixxle' ]),
|
2018-12-19 13:06:31 -05:00
|
|
|
{ pow : 'xixxle', _ : [] },
|
|
|
|
);
|
|
|
|
assertEqual(
|
2018-12-21 13:02:52 -05:00
|
|
|
parse([ '--host', 'localhost', '--port', '555' ]),
|
2018-12-19 13:06:31 -05:00
|
|
|
{ host : 'localhost', port : 555, _ : [] },
|
|
|
|
);
|
|
|
|
assertEqual(
|
2018-12-21 13:02:52 -05:00
|
|
|
parse([ '--host=localhost', '--port=555' ]),
|
2018-12-19 13:06:31 -05:00
|
|
|
{ host : 'localhost', port : 555, _ : [] },
|
|
|
|
);
|
|
|
|
});
|