aboutsummaryrefslogtreecommitdiff
path: root/imports/codemirror/mode/xquery/test/testQuotes.js
blob: 79e5142d9f136f464690ca5fdf9d1186089a3c7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  $(document).ready(function(){
    module("testQuoteEscape");
    test("testQuoteEscapeDouble", function() {
      expect(1);

      var input = 'let $rootfolder := "c:\\builds\\winnt\\HEAD\\qa\\scripts\\"\
let $keysfolder := concat($rootfolder, "keys\\")\
return\
$keysfolder';
      var expected = '<span class="cm-keyword">let</span> <span class="cm-variable">$rootfolder</span> <span class="cm-keyword">:=</span> <span class="cm-string">"c:\\builds\\winnt\\HEAD\\qa\\scripts\\"</span><span class="cm-keyword">let</span> <span class="cm-variable">$keysfolder</span> <span class="cm-keyword">:=</span> <span class="cm-variable cm-def">concat</span>(<span class="cm-variable">$rootfolder</span>, <span class="cm-string">"keys\\"</span>)<span class="cm-word">return$keysfolder</span>';

      $("#sandbox").html('<textarea id="editor">' + input + '</textarea>');
      var editor = CodeMirror.fromTextArea($("#editor")[0]);
      var result = $(".CodeMirror-lines div div pre")[0].innerHTML;

       equal(result, expected);
       $("#editor").html("");
    });
  });