[geary/wip/771643-replace-intltool] Workaround a xgettext warning about a Vala verbatim comment.



commit 2dd9c352eee6f23469b0d3a99b90b2e3e91e6982
Author: Michael James Gratton <mike vee net>
Date:   Thu Oct 26 17:08:29 2017 +1100

    Workaround a xgettext warning about a Vala verbatim comment.

 src/engine/util/util-js.vala  |   16 ++++++++--------
 test/engine/util-js-test.vala |    1 -
 2 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/src/engine/util/util-js.vala b/src/engine/util/util-js.vala
index 4d22429..4c5108e 100644
--- a/src/engine/util/util-js.vala
+++ b/src/engine/util/util-js.vala
@@ -177,31 +177,31 @@ namespace Geary.JS {
                     builder.append("\x00");
                     break;
                 case '\'':
-                    builder.append("""\'""");
+                    builder.append("\\\'");
                     break;
                 case '"':
-                    builder.append("""\"""");
+                    builder.append("\\\"");
                     break;
                 case '\\':
-                    builder.append("""\\""");
+                    builder.append("\\\\");
                     break;
                 case '\n':
-                    builder.append("""\n""");
+                    builder.append("\\n");
                     break;
                 case '\r':
-                    builder.append("""\r""");
+                    builder.append("\\r");
                     break;
                 case '\x0b':
                     builder.append("\x0b");
                     break;
                 case '\t':
-                    builder.append("""\t""");
+                    builder.append("\\t");
                     break;
                 case '\b':
-                    builder.append("""\b""");
+                    builder.append("\\b");
                     break;
                 case '\f':
-                    builder.append("""\f""");
+                    builder.append("\\f");
                     break;
                 default:
                     builder.append_unichar(c);
diff --git a/test/engine/util-js-test.vala b/test/engine/util-js-test.vala
index e908105..eb087cc 100644
--- a/test/engine/util-js-test.vala
+++ b/test/engine/util-js-test.vala
@@ -13,7 +13,6 @@ public class Geary.JS.Test : Gee.TestCase {
     }
 
     public void escape_string() {
-        print("\ndata: %s\n", Geary.JS.escape_string("\n"));
         assert(Geary.JS.escape_string("\n") == """\n""");
         assert(Geary.JS.escape_string("\r") == """\r""");
         assert(Geary.JS.escape_string("\t") == """\t""");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]