Skip to content

Commit 6b7f8e5

Browse files
committed
- Make StackTraceTest.testFailureStackTrace work in all OS
- build.xml: add 'test' target part of the build
1 parent 9771cbb commit 6b7f8e5

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

build.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Ahmed Ashour
4343
<ant antfile="src/build.xml" target="junit"/>
4444
</target>
4545

46-
<target name="repackage" depends="clean-compile">
46+
<target name="repackage" depends="test">
4747
<property name="corejs.dir" value="${repackaged-rhino.dir}/src/net/sourceforge/htmlunit/corejs"/>
4848

4949
<mkdir dir="${corejs.dir}"/>

src/net/sourceforge/htmlunit/StackTraceTest.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@ public class StackTraceTest {
2020
*/
2121
@Test
2222
public void testFailureStackTrace() {
23+
final String lineSeparator = System.getProperty("line.separator");
2324
final String source1 = "function f2() { throw 'hello'; }; f2();";
2425
final String source2 = "function f2() { 'H'.toLowerCase(); throw 'hello'; }; f2();";
2526

26-
runWithExpectedStackTrace(source1, " at test.js (f2)\n\tat test.js\n"); // works
27-
runWithExpectedStackTrace(source2, " at test.js (f2)\n\tat test.js\n"); // fails
27+
runWithExpectedStackTrace(source1,
28+
" at test.js (f2)" + lineSeparator + "\tat test.js" + lineSeparator); // works
29+
runWithExpectedStackTrace(source2,
30+
" at test.js (f2)" + lineSeparator + "\tat test.js" + lineSeparator); // fails
2831
}
2932

3033
private void runWithExpectedStackTrace(final String _source, final String _expectedStackTrace) {

0 commit comments

Comments
 (0)