Show More
@@ -1,58 +1,58 b'' | |||
|
1 | 1 | casper.notebook_test(function () { |
|
2 | 2 | this.on('remote.callback', function(data){ |
|
3 | 3 | if(data.error_expected){ |
|
4 | 4 | that.test.assertEquals( |
|
5 | 5 | data.error, |
|
6 |
|
|
|
7 |
"!highlight: " + data.provided + " errors |
|
|
6 | true, | |
|
7 | "!highlight: " + data.provided + " errors" | |
|
8 | 8 | ); |
|
9 | 9 | }else{ |
|
10 | 10 | that.test.assertEquals( |
|
11 | 11 | data.observed, |
|
12 | 12 | data.expected, |
|
13 | 13 | "highlight: " + data.provided + " as " + data.expected |
|
14 | 14 | ); |
|
15 | 15 | } |
|
16 | 16 | }); |
|
17 | 17 | |
|
18 | 18 | var that = this; |
|
19 | 19 | // syntax highlighting |
|
20 | 20 | [ |
|
21 | 21 | {to: "gfm"}, |
|
22 | 22 | {to: "python"}, |
|
23 | 23 | {to: "ipython"}, |
|
24 | 24 | {to: "ipythongfm"}, |
|
25 | 25 | {to: "text/x-markdown", from: [".md"]}, |
|
26 | 26 | {to: "text/x-python", from: [".py", "Python"]}, |
|
27 | 27 | {to: "application/json", from: ["json", "JSON"]}, |
|
28 | 28 | {to: "text/x-ruby", from: [".rb", "ruby", "Ruby"]}, |
|
29 | 29 | {to: "application/ld+json", from: ["json-ld", "JSON-LD"]}, |
|
30 | 30 | {from: [".pyc"], error: true}, |
|
31 | 31 | {from: ["../"], error: true}, |
|
32 | 32 | {from: ["//"], error: true}, |
|
33 | 33 | ].map(function (mode) { |
|
34 | 34 | (mode.from || []).concat(mode.to || []).map(function(from){ |
|
35 | 35 | casper.evaluate(function(from, expected, error_expected){ |
|
36 | 36 | IPython.utils.requireCodeMirrorMode(from, function(observed){ |
|
37 | 37 | window.callPhantom({ |
|
38 | 38 | provided: from, |
|
39 | 39 | expected: expected, |
|
40 | 40 | observed: observed, |
|
41 | 41 | error_expected: error_expected |
|
42 | 42 | }); |
|
43 | 43 | }, function(error){ |
|
44 | 44 | window.callPhantom({ |
|
45 | 45 | provided: from, |
|
46 | 46 | expected: expected, |
|
47 |
error: |
|
|
47 | error: true, | |
|
48 | 48 | error_expected: error_expected |
|
49 |
}); |
|
|
49 | }); | |
|
50 | 50 | }); |
|
51 | 51 | }, { |
|
52 | 52 | from: from, |
|
53 | 53 | expected: mode.to, |
|
54 | 54 | error_expected: mode.error |
|
55 | 55 | }); |
|
56 | 56 | }); |
|
57 | 57 | }); |
|
58 | 58 | }); No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now