@@ -458,10 +458,9 @@ describe("queryUtils", () => {
458458 assert . strictEqual ( res , "a:1" ) ;
459459 } ) ;
460460
461- it ( "should remove line comment" , ( ) => {
461+ it ( "should preserve line comment" , ( ) => {
462462 const res = queryUtils . normalizeQSQLQuery ( "a:1 / line comment" ) ;
463-
464- assert . strictEqual ( res , "a:1" ) ;
463+ assert . strictEqual ( res , "a:1 / line comment" ) ;
465464 } ) ;
466465
467466 it ( "should ignore line comment in a string" , ( ) => {
@@ -470,18 +469,18 @@ describe("queryUtils", () => {
470469 assert . strictEqual ( res , 'a:"1 / not line comment"' ) ;
471470 } ) ;
472471
473- it ( "should replace EOS with semicolon" , ( ) => {
472+ it ( "should replace EOS with semicolon preserve new lines " , ( ) => {
474473 let res = queryUtils . normalizeQSQLQuery ( "a:1\na" ) ;
475- assert . strictEqual ( res , "a:1;a " ) ;
474+ assert . strictEqual ( res , "a:1;\na " ) ;
476475 res = queryUtils . normalizeQSQLQuery ( "a:1\r\na" ) ;
477- assert . strictEqual ( res , "a:1;a " ) ;
476+ assert . strictEqual ( res , "a:1;\r\na " ) ;
478477 } ) ;
479478
480- it ( "should escpae new lines in strings" , ( ) => {
481- let res = queryUtils . normalizeQSQLQuery ( 'a:"a\n \nb "' ) ;
482- assert . strictEqual ( res , 'a:"a\\n \\nb "' ) ;
483- res = queryUtils . normalizeQSQLQuery ( 'a:"a\r\n \r\nb "' ) ;
484- assert . strictEqual ( res , 'a:"a\\n \\nb "' ) ;
479+ it ( "should preserve new lines in strings" , ( ) => {
480+ let res = queryUtils . normalizeQSQLQuery ( 'a:"a\n\n b "' ) ;
481+ assert . strictEqual ( res , 'a:"a\n \n b "' ) ;
482+ res = queryUtils . normalizeQSQLQuery ( 'a:"a\r\n\r\n b "' ) ;
483+ assert . strictEqual ( res , 'a:"a\r\n\r\n b "' ) ;
485484 } ) ;
486485 } ) ;
487486
@@ -602,10 +601,9 @@ describe("queryUtils", () => {
602601 describe ( "getQSQLWrapper" , ( ) => {
603602 let queryWrappeStub : sinon . SinonStub ;
604603
605- it ( "should normalize q code " , ( ) => {
604+ it ( "should not add extra semicolon " , ( ) => {
606605 const res = queryUtils . getQSQLWrapper ( "a:1;\na" ) ;
607-
608- assert . strictEqual ( res , "a:1;;a" ) ;
606+ assert . strictEqual ( res , "a:1;\na" ) ;
609607 } ) ;
610608
611609 it ( "should normalize python code using wrapper" , ( ) => {
0 commit comments