michael@0: /* vim:set ts=2 sw=2 sts=2 et: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: var subscriptLoaded = false; michael@0: michael@0: function run_test() { michael@0: var lf = do_get_file("file.txt"); michael@0: do_check_true(lf.exists()); michael@0: do_check_true(lf.isFile()); michael@0: // check that allowNonexistent works michael@0: lf = do_get_file("file.txt.notfound", true); michael@0: do_check_false(lf.exists()); michael@0: // check that we can get a file from a subdirectory michael@0: lf = do_get_file("subdir/file.txt"); michael@0: do_check_true(lf.exists()); michael@0: do_check_true(lf.isFile()); michael@0: // and that we can get a handle to a directory itself michael@0: lf = do_get_file("subdir/"); michael@0: do_check_true(lf.exists()); michael@0: do_check_true(lf.isDirectory()); michael@0: // check that we can go up a level michael@0: lf = do_get_file(".."); michael@0: do_check_true(lf.exists()); michael@0: lf.append("unit"); michael@0: lf.append("file.txt"); michael@0: do_check_true(lf.exists()); michael@0: // check that do_get_cwd works michael@0: lf = do_get_cwd(); michael@0: do_check_true(lf.exists()); michael@0: do_check_true(lf.isDirectory()); michael@0: }