Skip to content
This repository has been archived by the owner on Dec 10, 2022. It is now read-only.

Commit

Permalink
Somehow g++ doesn't like \u0000 (it generates a \1 ??), so let's use \0
Browse files Browse the repository at this point in the history
  • Loading branch information
soywiz committed May 19, 2017
1 parent 12ecee4 commit 96e6ba8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions jtransc-main/test/JsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ import testservice.test.TestServiceJs2
class JsTest : _Base() {
override val DEFAULT_TARGET = JsTarget()

@Test fun testBig() = testClass<BigTest>(minimize = false, log = false)
@Test fun testBigMin() = testClass<BigTest>(minimize = true, log = false)
@Test fun testBigIO() = testClass<BigIOTest>(minimize = true, log = false, treeShaking = true)
@Test fun testProcess() = testClass<ProcessTest>(minimize = true, log = false, treeShaking = true)

@Test fun testJTranscBug110() = testClass<JTranscBug110>(minimize = false, log = false, treeShaking = true)

@Test fun testScriptEngine() = testClass<ScriptEngineTest>(minimize = false, log = false, treeShaking = true)
Expand Down Expand Up @@ -153,11 +158,6 @@ class JsTest : _Base() {
OK
""", minimize = true)

@Test fun testBig() = testClass<BigTest>(minimize = false, log = false)
@Test fun testBigMin() = testClass<BigTest>(minimize = true, log = false)
@Test fun testBigIO() = testClass<BigIOTest>(minimize = true, log = false, treeShaking = true)
@Test fun testProcess() = testClass<ProcessTest>(minimize = true, log = false, treeShaking = true)

@Test fun testNumberFormatTest2() = testClass<NumberFormatTest2>(minimize = false, log = false)

@Test fun testTryFinallyCheck() = testClass<TryFinallyCheck>(minimize = false, log = false)
Expand Down
2 changes: 1 addition & 1 deletion jtransc-main/test/javatest/lang/StringsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private static void extendedTest() {
}

static public void zeroTest() {
String a = "abcdefg\0A\0B\0C\0";
String a = "STRZERO:abcdefg\0A\0B\0C\0\u0000\u0001\u0002\u0003\uffff\u7f7f\u007f\u00ff";
JTranscConsole.log("StringsTest.zeroTest:");
JTranscConsole.log(a.length());
for (int n = 0; n < a.length(); n++) JTranscConsole.log((int)a.charAt(n));
Expand Down
1 change: 1 addition & 0 deletions jtransc-utils/src/com/jtransc/text/escape.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ fun String.uescape(): String {
for (n in 0 until this.length) {
val c = this[n]
when (c) {
0.toChar() -> out.append("\\0")
'\\' -> out.append("\\\\")
'"' -> out.append("\\\"")
'\n' -> out.append("\\n")
Expand Down

0 comments on commit 96e6ba8

Please sign in to comment.