blob: 8d3ba7f64ba142bd8b8b125503c136068ccba728 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
<!DOCTYPE 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.
-->
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Closure Unit Tests - goog.i18n.uChar.LocalNameFetcher</title>
<meta charset="utf-8">
<script src='../../base.js'>
</script>
<script>
goog.require('goog.i18n.uChar.LocalNameFetcher');
goog.require('goog.testing.jsunit');
goog.require('goog.testing.recordFunction');
</script>
</head>
<body>
<script>
var nameFetcher = null;
function setUp() {
nameFetcher = new goog.i18n.uChar.LocalNameFetcher();
}
function testGetName_exists() {
var callback = goog.testing.recordFunction(function(name) {
assertEquals('Space', name);
});
nameFetcher.getName(' ', callback);
assertEquals(1, callback.getCallCount());
}
function testGetName_variationSelector() {
var callback = goog.testing.recordFunction(function(name) {
assertEquals('Variation Selector - 1', name);
});
nameFetcher.getName('\ufe00', callback);
assertEquals(1, callback.getCallCount());
}
function testGetName_missing() {
var callback = goog.testing.recordFunction(function(name) {
assertNull(name);
});
nameFetcher.getName('P', callback);
assertEquals(1, callback.getCallCount());
}
function testIsNameAvailable_withAvailableName() {
assertTrue(nameFetcher.isNameAvailable(' '));
}
function testIsNameAvailable_withoutAvailableName() {
assertFalse(nameFetcher.isNameAvailable('a'));
}
</script>
</body>
</html>
|