##// END OF EJS Templates
Test IPython.utils.fixConsole() (really ansispan())
Mateusz Paprocki -
Show More
@@ -0,0 +1,23 b''
1 casper.notebook_test(function () {
2 var input = [
3 "\033[0m[\033[0minfo\033[0m] \033[0mtext\033[0m",
4 "\033[0m[\033[33mwarn\033[0m] \033[0m\tmore text\033[0m",
5 "\033[0m[\033[33mwarn\033[0m] \033[0m https://some/url/to/a/file.ext\033[0m",
6 "\033[0m[\033[31merror\033[0m] \033[0m\033[0m",
7 "\033[0m[\033[31merror\033[0m] \033[0m\teven more text\033[0m",
8 "\033[0m[\033[31merror\033[0m] \033[0m\t\tand more more text\033[0m"].join("\n");
9
10 var output = [
11 "[info] text",
12 "[<span class=\"ansiyellow\">warn</span>] \tmore text",
13 "[<span class=\"ansiyellow\">warn</span>] https://some/url/to/a/file.ext",
14 "[<span class=\"ansired\">error</span>] ",
15 "[<span class=\"ansired\">error</span>] \teven more text",
16 "[<span class=\"ansired\">error</span>] \t\tand more more text"].join("\n");
17
18 var result = this.evaluate(function (input) {
19 return IPython.utils.fixConsole(input);
20 }, input);
21
22 this.test.assertEquals(result, output, "IPython.util.fixConsole() handles [0m correctly");
23 });
General Comments 0
You need to be logged in to leave comments. Login now