diff options
Diffstat (limited to 'contexts/data/lib/closure-library/closure/goog/labs/testing/stringmatcher_test.html')
-rw-r--r-- | contexts/data/lib/closure-library/closure/goog/labs/testing/stringmatcher_test.html | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/contexts/data/lib/closure-library/closure/goog/labs/testing/stringmatcher_test.html b/contexts/data/lib/closure-library/closure/goog/labs/testing/stringmatcher_test.html deleted file mode 100644 index 9ad6dd4..0000000 --- a/contexts/data/lib/closure-library/closure/goog/labs/testing/stringmatcher_test.html +++ /dev/null @@ -1,91 +0,0 @@ -<!DOCTYPE html> -<html> -<!-- -Copyright 2012 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 - String matchers</title> -<script src="../../base.js"></script> -<script> - -goog.require('goog.labs.testing.ContainsStringMatcher'); -goog.require('goog.labs.testing.EndsWithMatcher'); -goog.require('goog.labs.testing.EqualsMatcher'); -goog.require('goog.labs.testing.EqualToIgnoringWhitespaceMatcher'); -goog.require('goog.labs.testing.StartsWithMatcher'); -goog.require('goog.labs.testing.StringContainsInOrderMatcher'); -goog.require('goog.labs.testing.assertThat'); -goog.require('goog.testing.jsunit'); - -</script> -</head> -<body> -<script> - -function testContainsString() { - goog.labs.testing.assertThat('hello', containsString('ell'), - 'hello contains ell'); - - assertMatcherError(function() { - goog.labs.testing.assertThat('hello', containsString('world!')); - }, 'containsString should throw exception when it fails'); -} - -function testEndsWith() { - goog.labs.testing.assertThat('hello', endsWith('llo'), 'hello ends with llo'); - - assertMatcherError(function() { - goog.labs.testing.assertThat('minutes', endsWith('midnight')); - }, 'endsWith should throw exception when it fails'); -} - -function testEqualToIgnoringWhitespace() { - goog.labs.testing.assertThat(' h\n EL L\tO', - equalToIgnoringWhitespace("h el l o"), - '" h EL L\tO " is equal to "h el l o"'); - - assertMatcherError(function() { - goog.labs.testing.assertThat('hybrid', equalToIgnoringWhitespace('theory')); - }, 'equalToIgnoringWhitespace should throw exception when it fails'); -} - -function testEquals() { - goog.labs.testing.assertThat('hello', equals('hello'), - 'hello equals hello'); - - assertMatcherError(function() { - goog.labs.testing.assertThat('thousand', equals('suns')); - }, 'equals should throw exception when it fails'); -} - -function testStartsWith() { - goog.labs.testing.assertThat('hello', startsWith('hel'), - 'hello starts with hel'); - - assertMatcherError(function() { - goog.labs.testing.assertThat('linkin', startsWith('park')); - }, 'startsWith should throw exception when it fails'); -} - -function testStringContainsInOrder() { - goog.labs.testing.assertThat('hello', - stringContainsInOrder(['h', 'el', 'el', 'l', 'o']), - 'hello contains in order: [h, el, l, o]'); - - assertMatcherError(function() { - goog.labs.testing.assertThat('hybrid', stringContainsInOrder(['hy', 'brid', - 'theory'])); - }, 'stringContainsInOrder should throw exception when it fails'); -} - -function assertMatcherError(callable, errorString) { - var e = assertThrows(errorString || 'callable throws exception', callable); - assertTrue(e instanceof goog.labs.testing.MatcherError); -} - -</script> -</body> -</html> |