forked from thinkpixellab/pl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pl.property_test.html
45 lines (36 loc) · 1.04 KB
/
pl.property_test.html
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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>PL Tests - pl.Property</title>
<script src="../../closure/closure/goog/base.js"></script>
<script src="deps.js"></script>
<script>
goog.require('goog.testing.asserts');
goog.require('goog.testing.jsunit');
goog.require('pl.Property');
</script>
</head>
<body>
<script>
function testWithoutDefault(){
var testProperty = new pl.Property("Test Property");
var object = {};
assertEquals(undefined, testProperty.get(object));
testProperty.set(object, "the foo!");
assertEquals("the foo!", testProperty.get(object));
testProperty.clear(object);
assertEquals(undefined, testProperty.get(object));
}
function testWithDefault(){
var testProperty = new pl.Property("Test Property", 42);
var object = {};
assertEquals(42, testProperty.get(object));
testProperty.set(object, "the foo!");
assertEquals("the foo!", testProperty.get(object));
testProperty.clear(object);
assertEquals(42, testProperty.get(object));
}
</script>
</body>
</html>