aboutsummaryrefslogtreecommitdiff
path: root/contexts/data/lib/closure-library/closure/goog/string/path_test.html
diff options
context:
space:
mode:
Diffstat (limited to 'contexts/data/lib/closure-library/closure/goog/string/path_test.html')
-rw-r--r--contexts/data/lib/closure-library/closure/goog/string/path_test.html82
1 files changed, 0 insertions, 82 deletions
diff --git a/contexts/data/lib/closure-library/closure/goog/string/path_test.html b/contexts/data/lib/closure-library/closure/goog/string/path_test.html
deleted file mode 100644
index 1e14ade..0000000
--- a/contexts/data/lib/closure-library/closure/goog/string/path_test.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<!doctype html>
-<html>
-<!--
-Copyright 2010 The Closure Library Authors. All Rights Reserved.
-
-Use of this source code is governed by the Apache License, Version 2.0.
-See the COPYING file for details.
--->
-<head>
-<title>Closure Unit Tests - goog.string.path</title>
-<script src="../base.js"></script>
-<script>
- goog.require('goog.string.path');
- goog.require('goog.testing.jsunit');
-</script>
-</head>
-<body>
-<script>
-
-// Some test data comes from Python's posixpath tests.
-// See http://svn.python.org/view/python/trunk/Lib/test/test_posixpath.py
-
-function testBasename() {
- assertEquals('bar', goog.string.path.basename('/foo/bar'));
- assertEquals('', goog.string.path.basename('/'));
- assertEquals('foo', goog.string.path.basename('foo'));
- assertEquals('foo', goog.string.path.basename('////foo'));
- assertEquals('bar', goog.string.path.basename('//foo//bar'));
-}
-
-function testDirname() {
- assertEquals('/foo', goog.string.path.dirname('/foo/bar'));
- assertEquals('/', goog.string.path.dirname('/'));
- assertEquals('', goog.string.path.dirname('foo'));
- assertEquals('////', goog.string.path.dirname('////foo'));
- assertEquals('//foo', goog.string.path.dirname('//foo//bar'));
-}
-
-function testJoin() {
- assertEquals('/bar/baz',
- goog.string.path.join('/foo', 'bar', '/bar', 'baz'));
- assertEquals('/foo/bar/baz',
- goog.string.path.join('/foo', 'bar', 'baz'));
- assertEquals('/foo/bar/baz/',
- goog.string.path.join('/foo/', 'bar/', 'baz/'))
-}
-
-function testNormalizePath() {
- assertEquals('.', goog.string.path.normalizePath(''));
- assertEquals('.', goog.string.path.normalizePath('./'));
- assertEquals('/', goog.string.path.normalizePath('/'));
- assertEquals('//', goog.string.path.normalizePath('//'));
- assertEquals('/', goog.string.path.normalizePath('///'));
- assertEquals('/foo/bar',
- goog.string.path.normalizePath('///foo/.//bar//'));
- assertEquals('/foo/baz',
- goog.string.path.normalizePath('///foo/.//bar//.//..//.//baz'));
- assertEquals('/foo/bar',
- goog.string.path.normalizePath('///..//./foo/.//bar'));
- assertEquals('../../cat/dog',
- goog.string.path.normalizePath('../../cat/dog/'));
- assertEquals('../dog',
- goog.string.path.normalizePath('../cat/../dog/'));
- assertEquals('/cat/dog',
- goog.string.path.normalizePath('/../cat/dog/'));
- assertEquals('/dog',
- goog.string.path.normalizePath('/../cat/../dog'));
- assertEquals('/dog',
- goog.string.path.normalizePath('/../../../dog'));
-}
-
-function testSplit() {
- assertArrayEquals(['/foo', 'bar'], goog.string.path.split('/foo/bar'));
- assertArrayEquals(['/', ''], goog.string.path.split('/'));
- assertArrayEquals(['', 'foo'], goog.string.path.split('foo'));
- assertArrayEquals(['////', 'foo'], goog.string.path.split('////foo'));
- assertArrayEquals(['//foo', 'bar'], goog.string.path.split('//foo//bar'));
-}
-
-</script>
-</body>
-</html>