Home | History | Annotate | Download | only in mjsunit

Lines Matching full:line

29 // For this test to work this file MUST have CR LF line endings.

68 // This is the last line of entire file (note: starting at 0).
70 // This is the last column of last line (note: starting at 0 and +2, due
74 // This magic number is the length or the first line comment (actually number
82 // The position of the first line of d(), i.e. "x = 1 ;".
84 // The line # of the first line of d() (note: starting at 0).
102 // Test that when running through source positions the position, line and
105 var line;
111 if (line == location.line) {
114 assertEquals(line + 1, location.line);
119 assertEquals(0, location.line);
125 line = location.line;
129 // Every line of d() is the same length. Verify we can loop through all
130 // positions and find the right line # for each.
132 for (line = 0; line < num_lines_d; line++) {
136 assertEquals(start_line_d + line, location.line);
144 assertEquals(0, script.locationFromPosition(0).line);
149 assertEquals(0, script.locationFromPosition(1).line);
154 assertEquals(0, script.locationFromPosition(start_a).line - comment_lines);
159 assertEquals(1, script.locationFromPosition(start_b).line - comment_lines);
164 assertEquals(4, script.locationFromPosition(start_c).line - comment_lines);
169 assertEquals(11, script.locationFromPosition(start_d).line - comment_lines);
172 // Test first line.
174 assertEquals(0, script.locationFromLine().line);
177 assertEquals(0, script.locationFromLine(0).line);
180 // Test first line column 1.
182 assertEquals(0, script.locationFromLine(0, 1).line);
185 // Test first line offset 1.
187 assertEquals(0, script.locationFromLine(0, 0, 1).line);
192 assertEquals(0, script.locationFromLine(void 0, void 0, start_a).line - comment_lines);
195 assertEquals(0, script.locationFromLine(0, void 0, start_a).line - comment_lines);
198 assertEquals(0, script.locationFromLine(0, 0, start_a).line - comment_lines);
201 // Test second line offset function a().
203 assertEquals(1, script.locationFromLine(1, 0, start_a).line - comment_lines);
206 // Test second line column 2 offset function a().
208 assertEquals(1, script.locationFromLine(1, 2, start_a).line - comment_lines);
213 assertEquals(1, script.locationFromLine(0, 0, start_b).line - comment_lines);
216 // Test second line offset function b().
218 assertEquals(2, script.locationFromLine(1, 0, start_b).line - comment_lines);
221 // Test second line column 11 offset function b().
223 assertEquals(2, script.locationFromLine(1, 11, start_b).line - comment_lines);
226 // Test second line column 12 offset function b. Second line in b is 11 long
227 // using column 12 wraps to next line.
229 assertEquals(3, script.locationFromLine(1, 12, start_b).line - comment_lines);
253 assertEquals(0, script.locationFromPosition(-1).line);
258 assertEquals(last_line, script.locationFromPosition(last_position).line);
261 // Test source line and restriction. All the following tests start from line 1
314 // All the following tests start from line 1 column 10 in function b, which is
327 // All the following tests start from line 1 column 0 in function b, which is
348 // Test that script.sourceLine(line) works.
349 for (line = 0; line < num_lines_d; line++) {
350 var line_content_regexp = new RegExp(" x = " + (line + 1));
351 assertTrue(line_content_regexp.test(script.sourceLine(start_line_d + line)));