annotate truffle/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/source/SourceSectionTest.java @ 21951:9c8c0937da41

Moving all sources into truffle subdirectory
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Wed, 17 Jun 2015 10:58:08 +0200
parents graal/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/source/SourceSectionTest.java@ae601ad0b023
children dc83cc1f94f2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
21647
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
1 /*
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
4 *
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
8 *
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
13 * accompanied this code).
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
14 *
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
18 *
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
21 * questions.
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
22 */
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
23 package com.oracle.truffle.api.test.source;
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
24
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
25 import static org.junit.Assert.*;
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
26
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
27 import org.junit.*;
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
28
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
29 import com.oracle.truffle.api.source.*;
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
30
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
31 public class SourceSectionTest {
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
32
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
33 private final Source emptySource = Source.fromText("", null);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
34
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
35 private final Source emptyLineSource = Source.fromText("\n", null);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
36
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
37 private final Source shortSource = Source.fromText("01", null);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
38
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
39 private final Source longSource = Source.fromText("01234\n67\n9\n", null);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
40
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
41 public void emptySourceTest0() {
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
42 SourceSection section = emptySource.createSection("test", 0, 0);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
43 assertNotNull(section);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
44 assertEquals(section.getCode(), "");
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
45 }
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
46
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
47 @Test
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
48 public void emptyLineTest0() {
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
49 SourceSection section = emptyLineSource.createSection("test", 0, 0);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
50 assertNotNull(section);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
51 assertEquals(section.getCode(), "");
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
52 assertEquals(section.getCharIndex(), 0);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
53 assertEquals(section.getCharLength(), 0);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
54 assertEquals(section.getStartLine(), 1);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
55 assertEquals(section.getStartColumn(), 1);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
56 }
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
57
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
58 @Ignore
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
59 @Test
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
60 public void emptyLineTest0a() {
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
61 SourceSection section = emptyLineSource.createSection("test", 0, 0);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
62 assertEquals(section.getEndLine(), 1);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
63 assertEquals(section.getEndColumn(), 1);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
64 }
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
65
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
66 @Test
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
67 public void emptyLineTest1() {
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
68 SourceSection section = emptyLineSource.createSection("test", 0, 1);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
69 assertNotNull(section);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
70 assertEquals(section.getCode(), "\n");
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
71 assertEquals(section.getCharIndex(), 0);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
72 assertEquals(section.getCharLength(), 1);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
73 assertEquals(section.getStartLine(), 1);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
74 assertEquals(section.getStartColumn(), 1);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
75 assertEquals(section.getEndLine(), 1);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
76 assertEquals(section.getEndColumn(), 1);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
77 }
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
78
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
79 @Ignore
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
80 @Test
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
81 public void emptyLineTest2() {
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
82 SourceSection section = emptyLineSource.createSection("test", 1, 0);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
83 assertNotNull(section);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
84 assertEquals(section.getCode(), "");
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
85 assertEquals(section.getCharIndex(), 1);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
86 assertEquals(section.getCharLength(), 0);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
87 assertEquals(section.getStartLine(), 1);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
88 assertEquals(section.getStartColumn(), 1);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
89 assertEquals(section.getEndLine(), 1);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
90 assertEquals(section.getEndColumn(), 1);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
91 }
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
92
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
93 @Test
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
94 public void emptySectionTest2() {
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
95 SourceSection section = shortSource.createSection("test", 0, 0);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
96 assertNotNull(section);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
97 assertEquals(section.getCode(), "");
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
98 }
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
99
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
100 @Test
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
101 public void emptySectionTest3() {
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
102 SourceSection section = longSource.createSection("test", 0, 0);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
103 assertNotNull(section);
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
104 assertEquals(section.getCode(), "");
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
105 }
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
106
ae601ad0b023 Truffle/Source: add some tests for SourceSections, including a reported design issue with empty Soruces.
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents:
diff changeset
107 }