summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/xpath/4XPath/Core/test_literal_expr.html
blob: 16f075427eb8be45a2a847c66e0c7b369d6165ef (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
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../../js/resources/js-test-style.css">
<script src="../../../js/resources/js-test-pre.js"></script>
</head>
<body>
<div id="console"></div>

<script>
    shouldBe('document.evaluate(\'""\', document, null, XPathResult.STRING_TYPE, null).stringValue', '""');
    shouldBe('document.evaluate(\'"Hi"\', document, null, XPathResult.STRING_TYPE, null).stringValue', '"Hi"');
    shouldBe('document.evaluate(\'"NaN"\', document, null, XPathResult.STRING_TYPE, null).stringValue', '"NaN"');
    shouldBe('document.evaluate(\'"\u2022 = middle dot"\', document, null, XPathResult.STRING_TYPE, null).stringValue', '"\u2022 = middle dot"');
    shouldBe('document.evaluate(\'"0"\', document, null, XPathResult.STRING_TYPE, null).stringValue', '"0"');
    shouldBe('document.evaluate(\'"1"\', document, null, XPathResult.STRING_TYPE, null).stringValue', '"1"');
    shouldBe('document.evaluate(\'"2"\', document, null, XPathResult.STRING_TYPE, null).stringValue', '"2"');
    shouldBe('document.evaluate(\'"3"\', document, null, XPathResult.STRING_TYPE, null).stringValue', '"3"');
    shouldBe('document.evaluate(\'"4"\', document, null, XPathResult.STRING_TYPE, null).stringValue', '"4"');
    shouldBe('document.evaluate(\'"5"\', document, null, XPathResult.STRING_TYPE, null).stringValue', '"5"');
    shouldBe('document.evaluate(\'"31"\', document, null, XPathResult.STRING_TYPE, null).stringValue', '"31"');
    shouldBe('document.evaluate(\'"-1"\', document, null, XPathResult.STRING_TYPE, null).stringValue', '"-1"');
    shouldBe('document.evaluate(\'"-2"\', document, null, XPathResult.STRING_TYPE, null).stringValue', '"-2"');
    shouldBe('document.evaluate(\'"-3"\', document, null, XPathResult.STRING_TYPE, null).stringValue', '"-3"');
    shouldBe('document.evaluate(\'"-4"\', document, null, XPathResult.STRING_TYPE, null).stringValue', '"-4"');
    shouldBe('document.evaluate(\'"-5"\', document, null, XPathResult.STRING_TYPE, null).stringValue', '"-5"');
    shouldBe('document.evaluate(\'"3.1415926535"\', document, null, XPathResult.STRING_TYPE, null).stringValue', '"3.1415926535"');

    shouldBe('document.evaluate(\'0\', document, null, XPathResult.NUMBER_TYPE, null).numberValue', '0.0');
    shouldBe('document.evaluate(\'0.5\', document, null, XPathResult.NUMBER_TYPE, null).numberValue', '0.5');
    shouldBe('document.evaluate(\'-0.5\', document, null, XPathResult.NUMBER_TYPE, null).numberValue', '-0.5');
    shouldBe('document.evaluate(\'1\', document, null, XPathResult.NUMBER_TYPE, null).numberValue', '1.0');
    shouldBe('document.evaluate(\'-1\', document, null, XPathResult.NUMBER_TYPE, null).numberValue', '-1.0');
    shouldBe('document.evaluate(\'1.5\', document, null, XPathResult.NUMBER_TYPE, null).numberValue', '1.5');
    shouldBe('document.evaluate(\'-1.5\', document, null, XPathResult.NUMBER_TYPE, null).numberValue', '-1.5');
    shouldBe('document.evaluate(\'2\', document, null, XPathResult.NUMBER_TYPE, null).numberValue', '2.0');
    shouldBe('document.evaluate(\'-2\', document, null, XPathResult.NUMBER_TYPE, null).numberValue', '-2.0');
    shouldBe('document.evaluate(\'2.6\', document, null, XPathResult.NUMBER_TYPE, null).numberValue', '2.6');
    shouldBe('document.evaluate(\'-2.6\', document, null, XPathResult.NUMBER_TYPE, null).numberValue', '-2.6');
    shouldBe('document.evaluate(\'3\', document, null, XPathResult.NUMBER_TYPE, null).numberValue', '3.0');
    shouldBe('document.evaluate(\'-3\', document, null, XPathResult.NUMBER_TYPE, null).numberValue', '-3.0');
    shouldBe('document.evaluate(\'31\', document, null, XPathResult.NUMBER_TYPE, null).numberValue', '31.0');
    shouldBe('document.evaluate(\'4\', document, null, XPathResult.NUMBER_TYPE, null).numberValue', '4.0');
    shouldBe('document.evaluate(\'-4\', document, null, XPathResult.NUMBER_TYPE, null).numberValue', '-4.0');
    shouldBe('document.evaluate(\'4.5\', document, null, XPathResult.NUMBER_TYPE, null).numberValue', '4.5');
    shouldBe('document.evaluate(\'-4.5\', document, null, XPathResult.NUMBER_TYPE, null).numberValue', '-4.5');
    shouldBe('document.evaluate(\'5\', document, null, XPathResult.NUMBER_TYPE, null).numberValue', '5.0');
    shouldBe('document.evaluate(\'-5\', document, null, XPathResult.NUMBER_TYPE, null).numberValue', '-5.0');
    shouldBe('document.evaluate(\'-42\', document, null, XPathResult.NUMBER_TYPE, null).numberValue', '-42.0');

    var successfullyParsed = true;

</script>
<script src="../../../js/resources/js-test-post.js"></script>
</body>
</html>