michael@0: /* michael@0: * Copyright 2012, Mozilla Foundation and contributors michael@0: * michael@0: * Licensed under the Apache License, Version 2.0 (the "License"); michael@0: * you may not use this file except in compliance with the License. michael@0: * You may obtain a copy of the License at michael@0: * michael@0: * http://www.apache.org/licenses/LICENSE-2.0 michael@0: * michael@0: * Unless required by applicable law or agreed to in writing, software michael@0: * distributed under the License is distributed on an "AS IS" BASIS, michael@0: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. michael@0: * See the License for the specific language governing permissions and michael@0: * limitations under the License. michael@0: */ michael@0: michael@0: 'use strict'; michael@0: // michael@0: michael@0: // THIS FILE IS GENERATED FROM SOURCE IN THE GCLI PROJECT michael@0: // DO NOT EDIT IT DIRECTLY michael@0: michael@0: var exports = {}; michael@0: michael@0: var TEST_URI = "data:text/html;charset=utf-8,

gcli-testString.js

"; michael@0: michael@0: function test() { michael@0: return Task.spawn(function() { michael@0: let options = yield helpers.openTab(TEST_URI); michael@0: yield helpers.openToolbar(options); michael@0: gcli.addItems(mockCommands.items); michael@0: michael@0: yield helpers.runTests(options, exports); michael@0: michael@0: gcli.removeItems(mockCommands.items); michael@0: yield helpers.closeToolbar(options); michael@0: yield helpers.closeTab(options); michael@0: }).then(finish, helpers.handleError); michael@0: } michael@0: michael@0: // michael@0: michael@0: // var helpers = require('./helpers'); michael@0: michael@0: exports.testNewLine = function(options) { michael@0: return helpers.audit(options, [ michael@0: { michael@0: setup: 'echo a\\nb', michael@0: check: { michael@0: input: 'echo a\\nb', michael@0: hints: '', michael@0: markup: 'VVVVVVVVV', michael@0: cursor: 9, michael@0: current: 'message', michael@0: status: 'VALID', michael@0: args: { michael@0: command: { name: 'echo' }, michael@0: message: { michael@0: value: 'a\nb', michael@0: arg: ' a\\nb', michael@0: status: 'VALID', michael@0: message: '' michael@0: } michael@0: } michael@0: } michael@0: } michael@0: ]); michael@0: }; michael@0: michael@0: exports.testTab = function(options) { michael@0: return helpers.audit(options, [ michael@0: { michael@0: setup: 'echo a\\tb', michael@0: check: { michael@0: input: 'echo a\\tb', michael@0: hints: '', michael@0: markup: 'VVVVVVVVV', michael@0: cursor: 9, michael@0: current: 'message', michael@0: status: 'VALID', michael@0: args: { michael@0: command: { name: 'echo' }, michael@0: message: { michael@0: value: 'a\tb', michael@0: arg: ' a\\tb', michael@0: status: 'VALID', michael@0: message: '' michael@0: } michael@0: } michael@0: } michael@0: } michael@0: ]); michael@0: }; michael@0: michael@0: exports.testEscape = function(options) { michael@0: return helpers.audit(options, [ michael@0: { michael@0: // What's typed is actually: michael@0: // tsrsrsr a\\ b c michael@0: setup: 'tsrsrsr a\\\\ b c', michael@0: check: { michael@0: input: 'tsrsrsr a\\\\ b c', michael@0: hints: '', michael@0: markup: 'VVVVVVVVVVVVVVV', michael@0: status: 'VALID', michael@0: message: '', michael@0: args: { michael@0: command: { name: 'tsrsrsr' }, michael@0: p1: { value: 'a\\', arg: ' a\\\\', status: 'VALID', message: '' }, michael@0: p2: { value: 'b', arg: ' b', status: 'VALID', message: '' }, michael@0: p3: { value: 'c', arg: ' c', status: 'VALID', message: '' }, michael@0: } michael@0: } michael@0: }, michael@0: { michael@0: // What's typed is actually: michael@0: // tsrsrsr abc\\ndef asd asd michael@0: setup: 'tsrsrsr abc\\\\ndef asd asd', michael@0: check: { michael@0: input: 'tsrsrsr abc\\\\ndef asd asd', michael@0: hints: '', michael@0: markup: 'VVVVVVVVVVVVVVVVVVVVVVVVV', michael@0: status: 'VALID', michael@0: message: '', michael@0: args: { michael@0: command: { name: 'tsrsrsr' }, michael@0: p1: { michael@0: value: 'abc\\ndef', michael@0: arg: ' abc\\\\ndef', michael@0: status: 'VALID', michael@0: message: '' michael@0: }, michael@0: p2: { value: 'asd', arg: ' asd', status: 'VALID', message: '' }, michael@0: p3: { value: 'asd', arg: ' asd', status: 'VALID', message: '' }, michael@0: } michael@0: } michael@0: } michael@0: ]); michael@0: }; michael@0: michael@0: exports.testBlank = function(options) { michael@0: return helpers.audit(options, [ michael@0: { michael@0: setup: 'tsrsrsr a "" c', michael@0: check: { michael@0: input: 'tsrsrsr a "" c', michael@0: hints: '', michael@0: markup: 'VVVVVVVVVVVVVV', michael@0: cursor: 14, michael@0: current: 'p3', michael@0: status: 'ERROR', michael@0: message: '', michael@0: args: { michael@0: command: { name: 'tsrsrsr' }, michael@0: p1: { michael@0: value: 'a', michael@0: arg: ' a', michael@0: status: 'VALID', michael@0: message: '' michael@0: }, michael@0: p2: { michael@0: value: undefined, michael@0: arg: ' ""', michael@0: status: 'INCOMPLETE' michael@0: }, michael@0: p3: { michael@0: value: 'c', michael@0: arg: ' c', michael@0: status: 'VALID', michael@0: message: '' michael@0: } michael@0: } michael@0: } michael@0: }, michael@0: { michael@0: setup: 'tsrsrsr a b ""', michael@0: check: { michael@0: input: 'tsrsrsr a b ""', michael@0: hints: '', michael@0: markup: 'VVVVVVVVVVVVVV', michael@0: cursor: 14, michael@0: current: 'p3', michael@0: status: 'VALID', michael@0: message: '', michael@0: args: { michael@0: command: { name: 'tsrsrsr' }, michael@0: p1: { michael@0: value: 'a', michael@0: arg: ' a', michael@0: status:'VALID', michael@0: message: '' }, michael@0: p2: { michael@0: value: 'b', michael@0: arg: ' b', michael@0: status: 'VALID', michael@0: message: '' michael@0: }, michael@0: p3: { michael@0: value: '', michael@0: arg: ' ""', michael@0: status: 'VALID', michael@0: message: '' michael@0: } michael@0: } michael@0: } michael@0: } michael@0: ]); michael@0: }; michael@0: michael@0: exports.testBlankWithParam = function(options) { michael@0: return helpers.audit(options, [ michael@0: { michael@0: setup: 'tsrsrsr a --p3', michael@0: check: { michael@0: input: 'tsrsrsr a --p3', michael@0: hints: ' ', michael@0: markup: 'VVVVVVVVVVVVVVV', michael@0: cursor: 15, michael@0: current: 'p3', michael@0: status: 'ERROR', michael@0: message: '', michael@0: args: { michael@0: command: { name: 'tsrsrsr' }, michael@0: p1: { value: 'a', arg: ' a', status: 'VALID', message: '' }, michael@0: p2: { value: undefined, arg: '', status: 'INCOMPLETE' }, michael@0: p3: { value: '', arg: ' --p3', status: 'VALID', message: '' }, michael@0: } michael@0: } michael@0: }, michael@0: { michael@0: setup: 'tsrsrsr a --p3 ', michael@0: check: { michael@0: input: 'tsrsrsr a --p3 ', michael@0: hints: ' ', michael@0: markup: 'VVVVVVVVVVVVVVVV', michael@0: cursor: 16, michael@0: current: 'p3', michael@0: status: 'ERROR', michael@0: message: '', michael@0: args: { michael@0: command: { name: 'tsrsrsr' }, michael@0: p1: { value: 'a', arg: ' a', status: 'VALID', message: '' }, michael@0: p2: { value: undefined, arg: '', status: 'INCOMPLETE' }, michael@0: p3: { value: '', arg: ' --p3 ', status: 'VALID', message: '' }, michael@0: } michael@0: } michael@0: }, michael@0: { michael@0: setup: 'tsrsrsr a --p3 "', michael@0: check: { michael@0: input: 'tsrsrsr a --p3 "', michael@0: hints: ' ', michael@0: markup: 'VVVVVVVVVVVVVVVVV', michael@0: cursor: 17, michael@0: current: 'p3', michael@0: status: 'ERROR', michael@0: message: '', michael@0: args: { michael@0: command: { name: 'tsrsrsr' }, michael@0: p1: { value: 'a', arg: ' a', status: 'VALID', message: '' }, michael@0: p2: { value: undefined, arg: '', status: 'INCOMPLETE' }, michael@0: p3: { value: '', arg: ' --p3 "', status: 'VALID', message: '' }, michael@0: } michael@0: } michael@0: }, michael@0: { michael@0: setup: 'tsrsrsr a --p3 ""', michael@0: check: { michael@0: input: 'tsrsrsr a --p3 ""', michael@0: hints: ' ', michael@0: markup: 'VVVVVVVVVVVVVVVVVV', michael@0: cursor: 18, michael@0: current: 'p3', michael@0: status: 'ERROR', michael@0: message: '', michael@0: args: { michael@0: command: { name: 'tsrsrsr' }, michael@0: p1: { value: 'a', arg: ' a', status: 'VALID', message: '' }, michael@0: p2: { value: undefined, arg: '', status: 'INCOMPLETE' }, michael@0: p3: { value: '', arg: ' --p3 ""', status: 'VALID', message: '' }, michael@0: } michael@0: } michael@0: } michael@0: ]); michael@0: };