browser/devtools/commandline/test/browser_gcli_file.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/devtools/commandline/test/browser_gcli_file.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,839 @@
     1.4 +/*
     1.5 + * Copyright 2012, Mozilla Foundation and contributors
     1.6 + *
     1.7 + * Licensed under the Apache License, Version 2.0 (the "License");
     1.8 + * you may not use this file except in compliance with the License.
     1.9 + * You may obtain a copy of the License at
    1.10 + *
    1.11 + * http://www.apache.org/licenses/LICENSE-2.0
    1.12 + *
    1.13 + * Unless required by applicable law or agreed to in writing, software
    1.14 + * distributed under the License is distributed on an "AS IS" BASIS,
    1.15 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    1.16 + * See the License for the specific language governing permissions and
    1.17 + * limitations under the License.
    1.18 + */
    1.19 +
    1.20 +'use strict';
    1.21 +// <INJECTED SOURCE:START>
    1.22 +
    1.23 +// THIS FILE IS GENERATED FROM SOURCE IN THE GCLI PROJECT
    1.24 +// DO NOT EDIT IT DIRECTLY
    1.25 +
    1.26 +var exports = {};
    1.27 +
    1.28 +var TEST_URI = "data:text/html;charset=utf-8,<p id='gcli-input'>gcli-testFile.js</p>";
    1.29 +
    1.30 +function test() {
    1.31 +  return Task.spawn(function() {
    1.32 +    let options = yield helpers.openTab(TEST_URI);
    1.33 +    yield helpers.openToolbar(options);
    1.34 +    gcli.addItems(mockCommands.items);
    1.35 +
    1.36 +    yield helpers.runTests(options, exports);
    1.37 +
    1.38 +    gcli.removeItems(mockCommands.items);
    1.39 +    yield helpers.closeToolbar(options);
    1.40 +    yield helpers.closeTab(options);
    1.41 +  }).then(finish, helpers.handleError);
    1.42 +}
    1.43 +
    1.44 +// <INJECTED SOURCE:END>
    1.45 +
    1.46 +// var helpers = require('./helpers');
    1.47 +
    1.48 +var local = false;
    1.49 +
    1.50 +exports.testBasic = function(options) {
    1.51 +  return helpers.audit(options, [
    1.52 +    {
    1.53 +      // These tests require us to be using node directly or to be in
    1.54 +      // PhantomJS connected to an execute enabled node server or to be in
    1.55 +      // firefox.
    1.56 +      skipRemainingIf: options.isPhantomjs || options.isFirefox,
    1.57 +      setup:    'tsfile open /',
    1.58 +      check: {
    1.59 +        input:  'tsfile open /',
    1.60 +        hints:               '',
    1.61 +        markup: 'VVVVVVVVVVVVI',
    1.62 +        cursor: 13,
    1.63 +        current: 'p1',
    1.64 +        status: 'ERROR',
    1.65 +        message: '\'/\' is not a file',
    1.66 +        args: {
    1.67 +          command: { name: 'tsfile open' },
    1.68 +          p1: {
    1.69 +            value: undefined,
    1.70 +            arg: ' /',
    1.71 +            status: 'INCOMPLETE',
    1.72 +            message: '\'/\' is not a file'
    1.73 +          }
    1.74 +        }
    1.75 +      }
    1.76 +    },
    1.77 +    {
    1.78 +      setup:    'tsfile open /zxcv',
    1.79 +      check: {
    1.80 +        input:  'tsfile open /zxcv',
    1.81 +        // hints:                   ' -> /etc/',
    1.82 +        markup: 'VVVVVVVVVVVVIIIII',
    1.83 +        cursor: 17,
    1.84 +        current: 'p1',
    1.85 +        status: 'ERROR',
    1.86 +        message: '\'/zxcv\' doesn\'t exist',
    1.87 +        args: {
    1.88 +          command: { name: 'tsfile open' },
    1.89 +          p1: {
    1.90 +            value: undefined,
    1.91 +            arg: ' /zxcv',
    1.92 +            status: 'INCOMPLETE',
    1.93 +            message: '\'/zxcv\' doesn\'t exist'
    1.94 +          }
    1.95 +        }
    1.96 +      }
    1.97 +    },
    1.98 +    {
    1.99 +      skipIf: !local,
   1.100 +      setup:    'tsfile open /mach_kernel',
   1.101 +      check: {
   1.102 +        input:  'tsfile open /mach_kernel',
   1.103 +        hints:                          '',
   1.104 +        markup: 'VVVVVVVVVVVVVVVVVVVVVVVV',
   1.105 +        cursor: 24,
   1.106 +        current: 'p1',
   1.107 +        status: 'VALID',
   1.108 +        message: '',
   1.109 +        args: {
   1.110 +          command: { name: 'tsfile open' },
   1.111 +          p1: {
   1.112 +            value: '/mach_kernel',
   1.113 +            arg: ' /mach_kernel',
   1.114 +            status: 'VALID',
   1.115 +            message: ''
   1.116 +           }
   1.117 +        }
   1.118 +      }
   1.119 +    },
   1.120 +    {
   1.121 +      setup:    'tsfile saveas /',
   1.122 +      check: {
   1.123 +        input:  'tsfile saveas /',
   1.124 +        hints:                 '',
   1.125 +        markup: 'VVVVVVVVVVVVVVI',
   1.126 +        cursor: 15,
   1.127 +        current: 'p1',
   1.128 +        status: 'ERROR',
   1.129 +        message: '\'/\' already exists',
   1.130 +        args: {
   1.131 +          command: { name: 'tsfile saveas' },
   1.132 +          p1: {
   1.133 +            value: undefined,
   1.134 +            arg: ' /',
   1.135 +            status: 'INCOMPLETE',
   1.136 +            message: '\'/\' already exists'
   1.137 +          }
   1.138 +        }
   1.139 +      }
   1.140 +    },
   1.141 +    {
   1.142 +      setup:    'tsfile saveas /zxcv',
   1.143 +      check: {
   1.144 +        input:  'tsfile saveas /zxcv',
   1.145 +        // hints:                     ' -> /etc/',
   1.146 +        markup: 'VVVVVVVVVVVVVVVVVVV',
   1.147 +        cursor: 19,
   1.148 +        current: 'p1',
   1.149 +        status: 'VALID',
   1.150 +        message: '',
   1.151 +        args: {
   1.152 +          command: { name: 'tsfile saveas' },
   1.153 +          p1: {
   1.154 +            value: '/zxcv',
   1.155 +            arg: ' /zxcv',
   1.156 +            status: 'VALID',
   1.157 +            message: ''
   1.158 +          }
   1.159 +        }
   1.160 +      }
   1.161 +    },
   1.162 +    {
   1.163 +      skipIf: !local,
   1.164 +      setup:    'tsfile saveas /mach_kernel',
   1.165 +      check: {
   1.166 +        input:  'tsfile saveas /mach_kernel',
   1.167 +        hints:                            '',
   1.168 +        markup: 'VVVVVVVVVVVVVVIIIIIIIIIIII',
   1.169 +        cursor: 26,
   1.170 +        current: 'p1',
   1.171 +        status: 'ERROR',
   1.172 +        message: '\'/mach_kernel\' already exists',
   1.173 +        args: {
   1.174 +          command: { name: 'tsfile saveas' },
   1.175 +          p1: {
   1.176 +            value: undefined,
   1.177 +            arg: ' /mach_kernel',
   1.178 +            status: 'INCOMPLETE',
   1.179 +            message: '\'/mach_kernel\' already exists'
   1.180 +          }
   1.181 +        }
   1.182 +      }
   1.183 +    },
   1.184 +    {
   1.185 +      setup:    'tsfile save /',
   1.186 +      check: {
   1.187 +        input:  'tsfile save /',
   1.188 +        hints:               '',
   1.189 +        markup: 'VVVVVVVVVVVVI',
   1.190 +        cursor: 13,
   1.191 +        current: 'p1',
   1.192 +        status: 'ERROR',
   1.193 +        message: '\'/\' is not a file',
   1.194 +        args: {
   1.195 +          command: { name: 'tsfile save' },
   1.196 +          p1: {
   1.197 +            value: undefined,
   1.198 +            arg: ' /',
   1.199 +            status: 'INCOMPLETE',
   1.200 +            message: '\'/\' is not a file'
   1.201 +          }
   1.202 +        }
   1.203 +      }
   1.204 +    },
   1.205 +    {
   1.206 +      setup:    'tsfile save /zxcv',
   1.207 +      check: {
   1.208 +        input:  'tsfile save /zxcv',
   1.209 +        // hints:                   ' -> /etc/',
   1.210 +        markup: 'VVVVVVVVVVVVVVVVV',
   1.211 +        cursor: 17,
   1.212 +        current: 'p1',
   1.213 +        status: 'VALID',
   1.214 +        message: '',
   1.215 +        args: {
   1.216 +          command: { name: 'tsfile save' },
   1.217 +          p1: {
   1.218 +            value: '/zxcv',
   1.219 +            arg: ' /zxcv',
   1.220 +            status: 'VALID',
   1.221 +            message: ''
   1.222 +          }
   1.223 +        }
   1.224 +      }
   1.225 +    },
   1.226 +    {
   1.227 +      skipIf: !local,
   1.228 +      setup:    'tsfile save /mach_kernel',
   1.229 +      check: {
   1.230 +        input:  'tsfile save /mach_kernel',
   1.231 +        hints:                          '',
   1.232 +        markup: 'VVVVVVVVVVVVVVVVVVVVVVVV',
   1.233 +        cursor: 24,
   1.234 +        current: 'p1',
   1.235 +        status: 'VALID',
   1.236 +        message: '',
   1.237 +        args: {
   1.238 +          command: { name: 'tsfile save' },
   1.239 +          p1: {
   1.240 +            value: '/mach_kernel',
   1.241 +            arg: ' /mach_kernel',
   1.242 +            status: 'VALID',
   1.243 +            message: ''
   1.244 +          }
   1.245 +        }
   1.246 +      }
   1.247 +    },
   1.248 +    {
   1.249 +      setup:    'tsfile cd /',
   1.250 +      check: {
   1.251 +        input:  'tsfile cd /',
   1.252 +        hints:             '',
   1.253 +        markup: 'VVVVVVVVVVV',
   1.254 +        cursor: 11,
   1.255 +        current: 'p1',
   1.256 +        status: 'VALID',
   1.257 +        message: '',
   1.258 +        args: {
   1.259 +          command: { name: 'tsfile cd' },
   1.260 +          p1: {
   1.261 +            value: '/',
   1.262 +            arg: ' /',
   1.263 +            status: 'VALID',
   1.264 +            message: ''
   1.265 +          }
   1.266 +        }
   1.267 +      }
   1.268 +    },
   1.269 +    {
   1.270 +      setup:    'tsfile cd /zxcv',
   1.271 +      check: {
   1.272 +        input:  'tsfile cd /zxcv',
   1.273 +        // hints:                 ' -> /dev/',
   1.274 +        markup: 'VVVVVVVVVVIIIII',
   1.275 +        cursor: 15,
   1.276 +        current: 'p1',
   1.277 +        status: 'ERROR',
   1.278 +        message: '\'/zxcv\' doesn\'t exist',
   1.279 +        args: {
   1.280 +          command: { name: 'tsfile cd' },
   1.281 +          p1: {
   1.282 +            value: undefined,
   1.283 +            arg: ' /zxcv',
   1.284 +            status: 'INCOMPLETE',
   1.285 +            message: '\'/zxcv\' doesn\'t exist'
   1.286 +          }
   1.287 +        }
   1.288 +      }
   1.289 +    },
   1.290 +    {
   1.291 +      skipIf: true || !local,
   1.292 +      setup:    'tsfile cd /etc/passwd',
   1.293 +      check: {
   1.294 +        input:  'tsfile cd /etc/passwd',
   1.295 +        hints:                       ' -> /etc/pam.d/',
   1.296 +        markup: 'VVVVVVVVVVIIIIIIIIIII',
   1.297 +        cursor: 21,
   1.298 +        current: 'p1',
   1.299 +        status: 'ERROR',
   1.300 +        message: '\'/etc/passwd\' is not a directory',
   1.301 +        args: {
   1.302 +          command: { name: 'tsfile cd' },
   1.303 +          p1: {
   1.304 +            value: undefined,
   1.305 +            arg: ' /etc/passwd',
   1.306 +            status: 'INCOMPLETE',
   1.307 +            message: '\'/etc/passwd\' is not a directory'
   1.308 +          }
   1.309 +        }
   1.310 +      }
   1.311 +    },
   1.312 +    {
   1.313 +      setup:    'tsfile mkdir /',
   1.314 +      check: {
   1.315 +        input:  'tsfile mkdir /',
   1.316 +        hints:                '',
   1.317 +        markup: 'VVVVVVVVVVVVVI',
   1.318 +        cursor: 14,
   1.319 +        current: 'p1',
   1.320 +        status: 'ERROR',
   1.321 +        message: ''/' already exists',
   1.322 +        args: {
   1.323 +          command: { name: 'tsfile mkdir' },
   1.324 +          p1: {
   1.325 +            value: undefined,
   1.326 +            arg: ' /',
   1.327 +            status: 'INCOMPLETE',
   1.328 +            message: '\'/\' already exists'
   1.329 +          }
   1.330 +        }
   1.331 +      }
   1.332 +    },
   1.333 +    {
   1.334 +      setup:    'tsfile mkdir /zxcv',
   1.335 +      check: {
   1.336 +        input:  'tsfile mkdir /zxcv',
   1.337 +        // hints:                    ' -> /dev/',
   1.338 +        markup: 'VVVVVVVVVVVVVVVVVV',
   1.339 +        cursor: 18,
   1.340 +        current: 'p1',
   1.341 +        status: 'VALID',
   1.342 +        message: '',
   1.343 +        args: {
   1.344 +          command: { name: 'tsfile mkdir' },
   1.345 +          p1: {
   1.346 +            value: '/zxcv',
   1.347 +            arg: ' /zxcv',
   1.348 +            status: 'VALID',
   1.349 +            message: ''
   1.350 +          }
   1.351 +        }
   1.352 +      }
   1.353 +    },
   1.354 +    {
   1.355 +      skipIf: !local,
   1.356 +      setup:    'tsfile mkdir /mach_kernel',
   1.357 +      check: {
   1.358 +        input:  'tsfile mkdir /mach_kernel',
   1.359 +        hints:                           '',
   1.360 +        markup: 'VVVVVVVVVVVVVIIIIIIIIIIII',
   1.361 +        cursor: 25,
   1.362 +        current: 'p1',
   1.363 +        status: 'ERROR',
   1.364 +        message: '\'/mach_kernel\' already exists',
   1.365 +        args: {
   1.366 +          command: { name: 'tsfile mkdir' },
   1.367 +          p1: {
   1.368 +            value: undefined,
   1.369 +            arg: ' /mach_kernel',
   1.370 +            status: 'INCOMPLETE',
   1.371 +            message: '\'/mach_kernel\' already exists'
   1.372 +          }
   1.373 +        }
   1.374 +      }
   1.375 +    },
   1.376 +    {
   1.377 +      setup:    'tsfile rm /',
   1.378 +      check: {
   1.379 +        input:  'tsfile rm /',
   1.380 +        hints:             '',
   1.381 +        markup: 'VVVVVVVVVVV',
   1.382 +        cursor: 11,
   1.383 +        current: 'p1',
   1.384 +        status: 'VALID',
   1.385 +        message: '',
   1.386 +        args: {
   1.387 +          command: { name: 'tsfile rm' },
   1.388 +          p1: {
   1.389 +            value: '/',
   1.390 +            arg: ' /',
   1.391 +            status: 'VALID',
   1.392 +            message: ''
   1.393 +          }
   1.394 +        }
   1.395 +      }
   1.396 +    },
   1.397 +    {
   1.398 +      setup:    'tsfile rm /zxcv',
   1.399 +      check: {
   1.400 +        input:  'tsfile rm /zxcv',
   1.401 +        // hints:                 ' -> /etc/',
   1.402 +        markup: 'VVVVVVVVVVIIIII',
   1.403 +        cursor: 15,
   1.404 +        current: 'p1',
   1.405 +        status: 'ERROR',
   1.406 +        message: '\'/zxcv\' doesn\'t exist',
   1.407 +        args: {
   1.408 +          command: { name: 'tsfile rm' },
   1.409 +          p1: {
   1.410 +            value: undefined,
   1.411 +            arg: ' /zxcv',
   1.412 +            status: 'INCOMPLETE',
   1.413 +            message: '\'/zxcv\' doesn\'t exist'
   1.414 +          }
   1.415 +        }
   1.416 +      }
   1.417 +    },
   1.418 +    {
   1.419 +      skipIf: !local,
   1.420 +      setup:    'tsfile rm /mach_kernel',
   1.421 +      check: {
   1.422 +        input:  'tsfile rm /mach_kernel',
   1.423 +        hints:                        '',
   1.424 +        markup: 'VVVVVVVVVVVVVVVVVVVVVV',
   1.425 +        cursor: 22,
   1.426 +        current: 'p1',
   1.427 +        status: 'VALID',
   1.428 +        message: '',
   1.429 +        args: {
   1.430 +          command: { name: 'tsfile rm' },
   1.431 +          p1: {
   1.432 +            value: '/mach_kernel',
   1.433 +            arg: ' /mach_kernel',
   1.434 +            status: 'VALID',
   1.435 +            message: ''
   1.436 +          }
   1.437 +        }
   1.438 +      }
   1.439 +    }
   1.440 +  ]);
   1.441 +};
   1.442 +
   1.443 +exports.testFirefoxBasic = function(options) {
   1.444 +  return helpers.audit(options, [
   1.445 +    {
   1.446 +      // These tests are just like the ones above tailored for running in
   1.447 +      // Firefox
   1.448 +      skipRemainingIf: true,
   1.449 +      // skipRemainingIf: !options.isFirefox,
   1.450 +      skipIf: true,
   1.451 +      setup:    'tsfile open /',
   1.452 +      check: {
   1.453 +        input:  'tsfile open /',
   1.454 +        hints:               '',
   1.455 +        markup: 'VVVVVVVVVVVVI',
   1.456 +        cursor: 13,
   1.457 +        current: 'p1',
   1.458 +        status: 'ERROR',
   1.459 +        message: '\'/\' is not a file',
   1.460 +        args: {
   1.461 +          command: { name: 'tsfile open' },
   1.462 +          p1: {
   1.463 +            value: undefined,
   1.464 +            arg: ' /',
   1.465 +            status: 'INCOMPLETE',
   1.466 +            message: '\'/\' is not a file'
   1.467 +          }
   1.468 +        }
   1.469 +      }
   1.470 +    },
   1.471 +    {
   1.472 +      skipIf: true,
   1.473 +      setup:    'tsfile open /zxcv',
   1.474 +      check: {
   1.475 +        input:  'tsfile open /zxcv',
   1.476 +        // hints:                   ' -> /etc/',
   1.477 +        markup: 'VVVVVVVVVVVVIIIII',
   1.478 +        cursor: 17,
   1.479 +        current: 'p1',
   1.480 +        status: 'ERROR',
   1.481 +        message: '\'/zxcv\' doesn\'t exist',
   1.482 +        args: {
   1.483 +          command: { name: 'tsfile open' },
   1.484 +          p1: {
   1.485 +            value: undefined,
   1.486 +            arg: ' /zxcv',
   1.487 +            status: 'INCOMPLETE',
   1.488 +            message: '\'/zxcv\' doesn\'t exist'
   1.489 +          }
   1.490 +        }
   1.491 +      }
   1.492 +    },
   1.493 +    {
   1.494 +      skipIf: !local,
   1.495 +      setup:    'tsfile open /mach_kernel',
   1.496 +      check: {
   1.497 +        input:  'tsfile open /mach_kernel',
   1.498 +        hints:                          '',
   1.499 +        markup: 'VVVVVVVVVVVVVVVVVVVVVVVV',
   1.500 +        cursor: 24,
   1.501 +        current: 'p1',
   1.502 +        status: 'VALID',
   1.503 +        message: '',
   1.504 +        args: {
   1.505 +          command: { name: 'tsfile open' },
   1.506 +          p1: {
   1.507 +            value: '/mach_kernel',
   1.508 +            arg: ' /mach_kernel',
   1.509 +            status: 'VALID',
   1.510 +            message: ''
   1.511 +           }
   1.512 +        }
   1.513 +      }
   1.514 +    },
   1.515 +    {
   1.516 +      skipIf: true,
   1.517 +      setup:    'tsfile saveas /',
   1.518 +      check: {
   1.519 +        input:  'tsfile saveas /',
   1.520 +        hints:                 '',
   1.521 +        markup: 'VVVVVVVVVVVVVVI',
   1.522 +        cursor: 15,
   1.523 +        current: 'p1',
   1.524 +        status: 'ERROR',
   1.525 +        message: '\'/\' already exists',
   1.526 +        args: {
   1.527 +          command: { name: 'tsfile saveas' },
   1.528 +          p1: {
   1.529 +            value: undefined,
   1.530 +            arg: ' /',
   1.531 +            status: 'INCOMPLETE',
   1.532 +            message: '\'/\' already exists'
   1.533 +          }
   1.534 +        }
   1.535 +      }
   1.536 +    },
   1.537 +    {
   1.538 +      skipIf: true,
   1.539 +      setup:    'tsfile saveas /zxcv',
   1.540 +      check: {
   1.541 +        input:  'tsfile saveas /zxcv',
   1.542 +        // hints:                     ' -> /etc/',
   1.543 +        markup: 'VVVVVVVVVVVVVVVVVVV',
   1.544 +        cursor: 19,
   1.545 +        current: 'p1',
   1.546 +        status: 'VALID',
   1.547 +        message: '',
   1.548 +        args: {
   1.549 +          command: { name: 'tsfile saveas' },
   1.550 +          p1: {
   1.551 +            value: '/zxcv',
   1.552 +            arg: ' /zxcv',
   1.553 +            status: 'VALID',
   1.554 +            message: ''
   1.555 +          }
   1.556 +        }
   1.557 +      }
   1.558 +    },
   1.559 +    {
   1.560 +      skipIf: !local,
   1.561 +      setup:    'tsfile saveas /mach_kernel',
   1.562 +      check: {
   1.563 +        input:  'tsfile saveas /mach_kernel',
   1.564 +        hints:                            '',
   1.565 +        markup: 'VVVVVVVVVVVVVVIIIIIIIIIIII',
   1.566 +        cursor: 26,
   1.567 +        current: 'p1',
   1.568 +        status: 'ERROR',
   1.569 +        message: '\'/mach_kernel\' already exists',
   1.570 +        args: {
   1.571 +          command: { name: 'tsfile saveas' },
   1.572 +          p1: {
   1.573 +            value: undefined,
   1.574 +            arg: ' /mach_kernel',
   1.575 +            status: 'INCOMPLETE',
   1.576 +            message: '\'/mach_kernel\' already exists'
   1.577 +          }
   1.578 +        }
   1.579 +      }
   1.580 +    },
   1.581 +    {
   1.582 +      skipIf: true,
   1.583 +      setup:    'tsfile save /',
   1.584 +      check: {
   1.585 +        input:  'tsfile save /',
   1.586 +        hints:               '',
   1.587 +        markup: 'VVVVVVVVVVVVI',
   1.588 +        cursor: 13,
   1.589 +        current: 'p1',
   1.590 +        status: 'ERROR',
   1.591 +        message: '\'/\' is not a file',
   1.592 +        args: {
   1.593 +          command: { name: 'tsfile save' },
   1.594 +          p1: {
   1.595 +            value: undefined,
   1.596 +            arg: ' /',
   1.597 +            status: 'INCOMPLETE',
   1.598 +            message: '\'/\' is not a file'
   1.599 +          }
   1.600 +        }
   1.601 +      }
   1.602 +    },
   1.603 +    {
   1.604 +      skipIf: true,
   1.605 +      setup:    'tsfile save /zxcv',
   1.606 +      check: {
   1.607 +        input:  'tsfile save /zxcv',
   1.608 +        // hints:                   ' -> /etc/',
   1.609 +        markup: 'VVVVVVVVVVVVVVVVV',
   1.610 +        cursor: 17,
   1.611 +        current: 'p1',
   1.612 +        status: 'VALID',
   1.613 +        message: '',
   1.614 +        args: {
   1.615 +          command: { name: 'tsfile save' },
   1.616 +          p1: {
   1.617 +            value: '/zxcv',
   1.618 +            arg: ' /zxcv',
   1.619 +            status: 'VALID',
   1.620 +            message: ''
   1.621 +          }
   1.622 +        }
   1.623 +      }
   1.624 +    },
   1.625 +    {
   1.626 +      skipIf: !local,
   1.627 +      setup:    'tsfile save /mach_kernel',
   1.628 +      check: {
   1.629 +        input:  'tsfile save /mach_kernel',
   1.630 +        hints:                          '',
   1.631 +        markup: 'VVVVVVVVVVVVVVVVVVVVVVVV',
   1.632 +        cursor: 24,
   1.633 +        current: 'p1',
   1.634 +        status: 'VALID',
   1.635 +        message: '',
   1.636 +        args: {
   1.637 +          command: { name: 'tsfile save' },
   1.638 +          p1: {
   1.639 +            value: '/mach_kernel',
   1.640 +            arg: ' /mach_kernel',
   1.641 +            status: 'VALID',
   1.642 +            message: ''
   1.643 +          }
   1.644 +        }
   1.645 +      }
   1.646 +    },
   1.647 +    {
   1.648 +      setup:    'tsfile cd /',
   1.649 +      check: {
   1.650 +        input:  'tsfile cd /',
   1.651 +        hints:             '',
   1.652 +        markup: 'VVVVVVVVVVV',
   1.653 +        cursor: 11,
   1.654 +        current: 'p1',
   1.655 +        status: 'VALID',
   1.656 +        message: '',
   1.657 +        args: {
   1.658 +          command: { name: 'tsfile cd' },
   1.659 +          p1: {
   1.660 +            value: '/',
   1.661 +            arg: ' /',
   1.662 +            status: 'VALID',
   1.663 +            message: ''
   1.664 +          }
   1.665 +        }
   1.666 +      }
   1.667 +    },
   1.668 +    {
   1.669 +      setup:    'tsfile cd /zxcv',
   1.670 +      check: {
   1.671 +        input:  'tsfile cd /zxcv',
   1.672 +        // hints:                 ' -> /dev/',
   1.673 +        // markup: 'VVVVVVVVVVIIIII',
   1.674 +        cursor: 15,
   1.675 +        current: 'p1',
   1.676 +        // status: 'ERROR',
   1.677 +        message: '\'/zxcv\' doesn\'t exist',
   1.678 +        args: {
   1.679 +          command: { name: 'tsfile cd' },
   1.680 +          p1: {
   1.681 +            value: undefined,
   1.682 +            arg: ' /zxcv',
   1.683 +            // status: 'INCOMPLETE',
   1.684 +            message: '\'/zxcv\' doesn\'t exist'
   1.685 +          }
   1.686 +        }
   1.687 +      }
   1.688 +    },
   1.689 +    {
   1.690 +      skipIf: true || !local,
   1.691 +      setup:    'tsfile cd /etc/passwd',
   1.692 +      check: {
   1.693 +        input:  'tsfile cd /etc/passwd',
   1.694 +        hints:                       ' -> /etc/pam.d/',
   1.695 +        markup: 'VVVVVVVVVVIIIIIIIIIII',
   1.696 +        cursor: 21,
   1.697 +        current: 'p1',
   1.698 +        status: 'ERROR',
   1.699 +        message: '\'/etc/passwd\' is not a directory',
   1.700 +        args: {
   1.701 +          command: { name: 'tsfile cd' },
   1.702 +          p1: {
   1.703 +            value: undefined,
   1.704 +            arg: ' /etc/passwd',
   1.705 +            status: 'INCOMPLETE',
   1.706 +            message: '\'/etc/passwd\' is not a directory'
   1.707 +          }
   1.708 +        }
   1.709 +      }
   1.710 +    },
   1.711 +    {
   1.712 +      setup:    'tsfile mkdir /',
   1.713 +      check: {
   1.714 +        input:  'tsfile mkdir /',
   1.715 +        hints:                '',
   1.716 +        markup: 'VVVVVVVVVVVVVI',
   1.717 +        cursor: 14,
   1.718 +        current: 'p1',
   1.719 +        status: 'ERROR',
   1.720 +        message: ''/' already exists',
   1.721 +        args: {
   1.722 +          command: { name: 'tsfile mkdir' },
   1.723 +          p1: {
   1.724 +            value: undefined,
   1.725 +            arg: ' /',
   1.726 +            status: 'INCOMPLETE',
   1.727 +            message: '\'/\' already exists'
   1.728 +          }
   1.729 +        }
   1.730 +      }
   1.731 +    },
   1.732 +    {
   1.733 +      setup:    'tsfile mkdir /zxcv',
   1.734 +      check: {
   1.735 +        input:  'tsfile mkdir /zxcv',
   1.736 +        // hints:                    ' -> /dev/',
   1.737 +        markup: 'VVVVVVVVVVVVVVVVVV',
   1.738 +        cursor: 18,
   1.739 +        current: 'p1',
   1.740 +        status: 'VALID',
   1.741 +        message: '',
   1.742 +        args: {
   1.743 +          command: { name: 'tsfile mkdir' },
   1.744 +          p1: {
   1.745 +            value: '/zxcv',
   1.746 +            arg: ' /zxcv',
   1.747 +            status: 'VALID',
   1.748 +            message: ''
   1.749 +          }
   1.750 +        }
   1.751 +      }
   1.752 +    },
   1.753 +    {
   1.754 +      skipIf: !local,
   1.755 +      setup:    'tsfile mkdir /mach_kernel',
   1.756 +      check: {
   1.757 +        input:  'tsfile mkdir /mach_kernel',
   1.758 +        hints:                           '',
   1.759 +        markup: 'VVVVVVVVVVVVVIIIIIIIIIIII',
   1.760 +        cursor: 25,
   1.761 +        current: 'p1',
   1.762 +        status: 'ERROR',
   1.763 +        message: '\'/mach_kernel\' already exists',
   1.764 +        args: {
   1.765 +          command: { name: 'tsfile mkdir' },
   1.766 +          p1: {
   1.767 +            value: undefined,
   1.768 +            arg: ' /mach_kernel',
   1.769 +            status: 'INCOMPLETE',
   1.770 +            message: '\'/mach_kernel\' already exists'
   1.771 +          }
   1.772 +        }
   1.773 +      }
   1.774 +    },
   1.775 +    {
   1.776 +      skipIf: true,
   1.777 +      setup:    'tsfile rm /',
   1.778 +      check: {
   1.779 +        input:  'tsfile rm /',
   1.780 +        hints:             '',
   1.781 +        markup: 'VVVVVVVVVVV',
   1.782 +        cursor: 11,
   1.783 +        current: 'p1',
   1.784 +        status: 'VALID',
   1.785 +        message: '',
   1.786 +        args: {
   1.787 +          command: { name: 'tsfile rm' },
   1.788 +          p1: {
   1.789 +            value: '/',
   1.790 +            arg: ' /',
   1.791 +            status: 'VALID',
   1.792 +            message: ''
   1.793 +          }
   1.794 +        }
   1.795 +      }
   1.796 +    },
   1.797 +    {
   1.798 +      skipIf: true,
   1.799 +      setup:    'tsfile rm /zxcv',
   1.800 +      check: {
   1.801 +        input:  'tsfile rm /zxcv',
   1.802 +        // hints:                 ' -> /etc/',
   1.803 +        markup: 'VVVVVVVVVVIIIII',
   1.804 +        cursor: 15,
   1.805 +        current: 'p1',
   1.806 +        status: 'ERROR',
   1.807 +        message: '\'/zxcv\' doesn\'t exist',
   1.808 +        args: {
   1.809 +          command: { name: 'tsfile rm' },
   1.810 +          p1: {
   1.811 +            value: undefined,
   1.812 +            arg: ' /zxcv',
   1.813 +            status: 'INCOMPLETE',
   1.814 +            message: '\'/zxcv\' doesn\'t exist'
   1.815 +          }
   1.816 +        }
   1.817 +      }
   1.818 +    },
   1.819 +    {
   1.820 +      skipIf: !local,
   1.821 +      setup:    'tsfile rm /mach_kernel',
   1.822 +      check: {
   1.823 +        input:  'tsfile rm /mach_kernel',
   1.824 +        hints:                        '',
   1.825 +        markup: 'VVVVVVVVVVVVVVVVVVVVVV',
   1.826 +        cursor: 22,
   1.827 +        current: 'p1',
   1.828 +        status: 'VALID',
   1.829 +        message: '',
   1.830 +        args: {
   1.831 +          command: { name: 'tsfile rm' },
   1.832 +          p1: {
   1.833 +            value: '/mach_kernel',
   1.834 +            arg: ' /mach_kernel',
   1.835 +            status: 'VALID',
   1.836 +            message: ''
   1.837 +          }
   1.838 +        }
   1.839 +      }
   1.840 +    }
   1.841 +  ]);
   1.842 +};

mercurial