X-Git-Url: https://git.donarmstrong.com/dactyl.git?a=blobdiff_plain;f=common%2Ftests%2Ffunctional%2FtestCommands.js;h=c65365acf0da90d6b110ef618283d886b01e6af1;hb=70740024f9c028c1fd63e1a1850ab062ff956054;hp=59724b559a9c54c898fea7c9d76281e34b6bfebd;hpb=718c614c183350706466e22939d0101ca4c87efe;p=dactyl.git diff --git a/common/tests/functional/testCommands.js b/common/tests/functional/testCommands.js index 59724b5..c65365a 100644 --- a/common/tests/functional/testCommands.js +++ b/common/tests/functional/testCommands.js @@ -47,12 +47,22 @@ var tests = { "!": { multiOutput: ["echo foo"] }, + get Clistkeys() this.listcommands, + Cmap: {}, + Cnoremap: {}, + Cunmap: {}, + get Ilistkeys() this.listcommands, + Imap: {}, + Inoremap: {}, + Iunmap: {}, abbreviate: { + error: ["!"], someOutput: ["", "abc"], noOutput: ["abc def", "-js abc def"], completions: ["", "abc ", "-js abc "] }, addons: { + error: ["!"], multiOutput: ["", "dactyl", "-type=extension", "-type=extension dactyl"], completions: [ "", @@ -75,6 +85,8 @@ var tests = { anyOutput: ["about:pentadactyl"], completions: [["", hasItems]] }, + get blistkeys() this.listcommands, + bmap: {}, bmark: { singleOutput: ["", "-tags=foo -title=bar -keyword=baz -charset=UTF-8 -post=quux about:pentadactyl"], error: ["-tags=foo -title=bar -keyword=baz -charset=nonExistentCharset -post=quux about:pentadactyl"], @@ -95,6 +107,7 @@ var tests = { "-max=1 -keyword=foo -tags=bar -title=baz about:" ] }, + bnoremap: {}, buffer: { anyOutput: ["", "1"], noOutput: ["!", "! 1"], @@ -104,15 +117,21 @@ var tests = { ] }, buffers: { + error: ["!"], multiOutput: ["", "1"], completions: ["", "1"] }, + bunmap: {}, cd: { + error: ["!"], singleOutput: ["", "~/"], completions: ["", "~/"] }, + get clistkeys() this.listcommands, + cmap: {}, + cnoremap: {}, colorscheme: { - error: ["", "some-nonexistent-scheme"] + error: ["!", "", "some-nonexistent-scheme"] }, command: { init: ["delc!"], @@ -131,15 +150,22 @@ var tests = { ["-group=user ", hasItems] ] }, - contexts: {}, // Not testable in this manner + completions: { + error: ["!", ""] + }, + contexts: { // Not testable in this manner + error: ["!"] + }, cookies: { anyOutput: ["dactyl.sf.net", "dactyl.sf.net list"], - error: [""], + error: ["!", ""], completions: [ "", ["dactyl.sf.net ", hasItems] ] }, + cunabbreviate: {}, + cunmap: {}, delbmarks: { anyOutput: ["", "about:pentadactyl"] }, delcommand: [ { @@ -157,8 +183,12 @@ var tests = { error: ["foo"] } ], + delgroup: { + error: ["", "! foo", "builtin"], + completions: [""] + }, delmacros: { - error: [""], + error: ["", "! foo"], noOutput: ["x"], completions: ["", "x"] }, @@ -168,17 +198,27 @@ var tests = { completions: ["", "-name=", "-name=foo ", "-index=", "-index="] }, dialog: { + error: ["!", ""], // Skip implementation for now completions: [ ["", hasntNullItems] ] }, - doautoall: {}, // Skip for now - doautocmd: {}, // Skip for now + dlclear: { + error: ["!"] + }, + doautoall: { + error: ["!"] + }, + doautocmd: { + error: ["!"] + }, downloads: { + error: ["!"], multiOutput: ["", "dactyl", "dactyl"] }, echo: { + error: ["!"], singleOutput: [ ["' - '", " - "] ], @@ -199,25 +239,35 @@ var tests = { __proto__: this.echo, }), get echomsg() this.echo, - else: {}, // Skip for now - elseif: {}, // Skip for now + else: { + error: ["!", "foo"] + }, + elseif: { + error: ["!", ""] + }, emenu: { noOutput: ["View.Zoom.Zoom In", "View.Zoom.Zoom Out"], - error: [""], + error: ["!", ""], completions: [ ["", hasItems], ["View.", hasItems] ] }, - endif: {}, // Skip for now + endif: { + error: ["!", "foo"] + }, execute: { + error: ["!"], noOutput: ["", "'js " + "".quote() + "'"], someOutput: ["'ls'"], completions: [["", hasItems]] }, + exit: { + error: ["foo"] + }, extadd: { completions: [["", hasItems]], - error: [""] + error: ["!", ""] }, extdelete: { completions: [["", hasItems]], @@ -239,12 +289,14 @@ var tests = { noOutput: [""], error: [""] }, - finish: { noOutput: [""] }, + finish: { + error: ["!", "foo"], + noOutput: [""] + }, forward: { noOutput: [""] }, - frameonly: { noOutput: [""] }, - delgroup: { - error: ["builtin"], - completions: [""] + frameonly: { + error: ["!", "foo"], + noOutput: [""] }, group: { multiOutput: [""], @@ -263,6 +315,7 @@ var tests = { }, hardcopy: {}, // Skip for now help: { + error: ["!"], noOutput: ["", "intro"], cleanup: ["tabdelete", "tabdelete"], completions: [ @@ -272,6 +325,7 @@ var tests = { }, get helpall() this.help, highlight: { + error: ["!"], multiOutput: ["", "Help"], noOutput: [ "Help foo: bar;", @@ -299,9 +353,17 @@ var tests = { "-sort=+date about:" ] }, - if: {}, // Skip for now + if: { + error: ["!", ""], + }, + iabbreviate: {}, + get ilistkeys() this.listcommands, + imap: {}, + inoremap: {}, + iunabbreviate: {}, + iunmap: {}, javascript: { - noOutput: ["''", "'\\n'", "
foo bar
", "window"], + noOutput: ["''", "'\\n'", "
foo bar
", "window", "<"], singleOutput: [""], multiOutput: ["g"] }, + nunmap: {}, open: { + error: ["!"], noOutput: ["about:blank | about:home"], completions: [ ["", hasItems], @@ -442,13 +526,18 @@ var tests = { pageinfo: { multiOutput: ["", "fgm"], completions: [["", hasItems]], - error: ["abcdefghijklmnopqrstuvwxyz", "f g m"] + error: ["!", "abcdefghijklmnopqrstuvwxyz", "f g m"] }, pagestyle: { + error: ["!"], completions: [""] }, - preferences: {}, // Skip for now + pintab: {}, + preferences: { + error: ["foo"] + }, pwd: { + error: ["!", "foo"], singleOutput: [""] }, qmark: { @@ -456,13 +545,16 @@ var tests = { "m", "m foo bar" ], - error: ["", "#"], + error: ["!", "", "#"], completions: [ ["", hasItems], ["m ", hasItems] ] }, qmarks: [ + { + error: ["!"] + }, { init: ["delqmarks a-zA-Z0-9"], error: ["", "x"], @@ -473,19 +565,30 @@ var tests = { completions: [["", hasItems]] } ], - quit: {}, // Skip for now - quitall: {}, // Skip for now + quit: { + error: ["foo"] + }, + quitall: { + error: ["!", "foo"] + }, redraw: { + error: ["!", "foo"], noOutput: [""] }, - rehash: {}, // Skip for now + rehash: { + error: ["!"] + }, reload: { + error: ["foo"], noOutput: [""] }, reloadall: { + error: ["foo"], noOutput: [""] }, - restart: {}, // Skip + restart: { + error: ["!", "foo"] + }, runtime: { init: [ "js File('~/.pentadactyl/some-nonexistent/good.css').write('')", @@ -501,6 +604,7 @@ var tests = { "some-nonexistent/good.penta" ], error: [ + "", "some-nonexistent/bad.js", "some-nonexistent/bad.penta" ], @@ -539,13 +643,16 @@ var tests = { }, saveas: {}, sbclose: { + error: ["!", "foo"], noOutput: [""] }, - scriptnames: {}, + scriptnames: { + error: ["!", "foo"] + }, set: { multiOutput: [ "vb?", "cpt?", "messages?", "titlestring?", "au?", "eht?", - "cpt", "messages", "titlestring", "au", "eht" + "cpt", "messages", "titlestring", "au", "eht", "! " ], noOutput: ["vb", "novb"], completions: [ @@ -595,6 +702,7 @@ var tests = { ] }, silent: { + error: ["!"], noOutput: [ "echo 'foo'", "echo " + "foo\nbar".quote(), @@ -613,6 +721,7 @@ var tests = { ".pentadactyl/some-nonexistent/good.penta" ], error: [ + "", ".pentadactyl/some-nonexistent/really-nonexistent.js", "~/.pentadactyl/some-nonexistent/bad.js", "~/.pentadactyl/some-nonexistent/bad.penta", @@ -629,9 +738,16 @@ var tests = { ["resource://dactyl/", hasItems] ] }), - stop: { noOutput: [""] }, - stopall: { noOutput: [""] }, + stop: { + error: ["!", "foo"], + noOutput: [""] + }, + stopall: { + error: ["!", "foo"], + noOutput: [""] + }, style: { + error: ["!"], cleanup: ["delstyle -n foo"], noOutput: [ "-name=foo http://does.not.exist/* div { display: inline; }", @@ -671,19 +787,59 @@ var tests = { ["-index=", hasNItems(2)] ] }, - tab: {}, - tabattach: {}, - tabdetach: {}, - tabdo: {}, - tabduplicate: {}, - tablast: {}, - tabmove: {}, - tabnext: {}, - tabonly: {}, + tab: { + error: ["!", "", "some-nonexistent-command"], + noOutput: ["js ''"], + anyOutput: ["echo 'foo'"], + completions: [["", hasItems]] + }, + tabattach: { + error: ["!", ""] + }, + tabdetach: { + error: ["!", "foo"] + }, + tabdo: { + error: ["!", "", "some-nonexistent-command"], + noOutput: ["js ''"], + anyOutput: ["echo 'foo'"], + completions: [["", hasItems]] + }, + tabduplicate: { + error: ["foo"] + }, + tablast: { + error: ["!", "foo"] + }, + tabmove: { + error: [""], + noOutput: ["1", "$", "999", "-1", "+1", "! +1", "! -1", "-999", "+999", "! +999", "! -999"], + completions: [ + ["", hasItems], + ["1", hasItems] + ] + }, + tabnext: { + error: ["!", "foo"] + }, + tabonly: { + error: ["!", "foo"] + }, tabopen: {}, - tabprevious: {}, - tabrewind: {}, - time: {}, + tabprevious: { + error: ["!", "foo"] + }, + tabrewind: { + error: ["!", "foo"] + }, + time: { + error: ["", ":some-nonexistent-command"/*, "some_nonexistent_reference"*/], // FIXME + singleOutput: [":js null", "null"] + + }, + get tlistkeys() this.listcommands, + tmap: {}, + tnoremap: {}, toolbarhide: { init: [ ["tbs Navigation Toolbar", toolbarState("#nav-bar", true)], @@ -694,7 +850,7 @@ var tests = { ["Navigation Toolbar", toolbarState("#nav-bar", false)], ["Bookmarks Toolbar", toolbarState("#PersonalToolbar", false)] ], - error: ["", "foo"] + error: ["!", "", "foo"] }, toolbarshow: { completions: [["", hasItems]], @@ -702,7 +858,7 @@ var tests = { ["Navigation Toolbar", toolbarState("#nav-bar", true)], ["Bookmarks Toolbar", toolbarState("#PersonalToolbar", true)] ], - error: ["", "foo"] + error: ["!", "", "foo"] }, toolbartoggle: { completions: [["", hasItems]], @@ -714,15 +870,25 @@ var tests = { ["Navigation Toolbar", toolbarState("#nav-bar", false)], ["Bookmarks Toolbar", toolbarState("#PersonalToolbar", false)] ], - error: ["", "foo"] + error: ["!", "", "foo"] }, + tunmap: {}, unabbreviate: { noOutput: ["abc", "! "], error: [""] }, - undo: {}, - undoall: {}, - unlet: {}, + undo: { + error: ["!"] + }, + undoall: { + error: ["!", "foo"] + }, + unpintab: { + error: ["!"] + }, + unlet: { + error: [""], + }, unmap: { noOutput: [ "i", @@ -738,8 +904,11 @@ var tests = { "-group=" ] }, - verbose: {}, + verbose: { + error: ["!", ""] + }, version: { + error: ["foo"], multiOutput: [ ["", function (msg) { var res = /(\w+dactyl) (\S+) \(([\^)]+)\) running on:\nMozilla/; @@ -748,11 +917,25 @@ var tests = { ] }, viewsource: {}, - winclose: {}, - window: {}, - winonly: {}, - winopen: {}, - wqall: {}, + get vlistkeys() this.listcommands, + vmap: {}, + vnoremap: {}, + vunmap: {}, + winclose: { + error: ["!", "foo"] + }, + window: { + error: ["!", ""] + }, + winonly: { + error: ["!", "foo"] + }, + winopen: { + error: ["!"] + }, + wqall: { + error: ["!", "foo"] + }, yank: { multiOutput: [ ["foo".quote(), /foo/], @@ -760,6 +943,7 @@ var tests = { [":addons", /Pentadactyl/] ], error: [ + "!", "", ":echoerr " + "foo".quote() ], completions: [