From e8d7262e6d06ef5b677ba6acee6c798908c8c236 Mon Sep 17 00:00:00 2001 From: James Padolsey Date: Sun, 27 Apr 2014 08:52:07 +0100 Subject: [PATCH] Line endings fix (unix). Add ', + '', + '', + '' + ].join('')); + }); + }); + describe('Quick tags + Single line parsing', function() { + it('Parses a simple doc from a single line', function() { + expect(siml.html5.parse('html (hd{meta[charset=utf-8]+title{"cool"}}bdy "Look ma, no hands!")',{pretty:false})).toBe([ + '', + '', + '', + 'cool', + '', + '', + 'Look ma, no hands!', + '', + '' + ].join('')); + }); + }); +}); diff --git a/test/resources/angular-test.siml b/test/resources/angular-test.siml index 782178a..df2b4e0 100644 --- a/test/resources/angular-test.siml +++ b/test/resources/angular-test.siml @@ -1,31 +1,31 @@ -section#main:cloak - @show( todos.length ) - - input#toggle-all:checkbox - @model( allChecked ) - @click( markAll(allChecked) ) - label[for=toggle-all] 'Mark all as complete' - - ul#todo-list > li - @repeat( todo in todos | filter:statusFilter ) - @class({ - completed: todo.completed, - editing: todo == editedTodo - }) - - div.view - input.toggle:checkbox - @model( todo.completed ) - @change( todoCompleted(todo) ) - label - '{{todo.title}}' - @dblclick( editTodo(todo) ) - button.destroy - @click( removeTodo(todo) ) - - form - @submit( doneEditing(todo) ) - input.edit - @model( todo.title ) - @$todoBlur( doneEditing(todo) ) +section#main:cloak + @show( todos.length ) + + input#toggle-all:checkbox + @model( allChecked ) + @click( markAll(allChecked) ) + label[for=toggle-all] 'Mark all as complete' + + ul#todo-list > li + @repeat( todo in todos | filter:statusFilter ) + @class({ + completed: todo.completed, + editing: todo == editedTodo + }) + + div.view + input.toggle:checkbox + @model( todo.completed ) + @change( todoCompleted(todo) ) + label + '{{todo.title}}' + @dblclick( editTodo(todo) ) + button.destroy + @click( removeTodo(todo) ) + + form + @submit( doneEditing(todo) ) + input.edit + @model( todo.title ) + @$todoBlur( doneEditing(todo) ) @$todoFocus( todo == editedTodo ) \ No newline at end of file diff --git a/test/resources/buildParser.js b/test/resources/buildParser.js index b42333e..302ac42 100644 --- a/test/resources/buildParser.js +++ b/test/resources/buildParser.js @@ -1,13 +1,13 @@ -function buildParser(src) { - - var xhr = new XMLHttpRequest(); - xhr.open('GET', src + '?' + +new Date, false); - xhr.send(null); - var parserCode = xhr.responseText; - - siml.PARSER = PEG.buildParser(parserCode, { - cache: false, - trackLineAndColumn: true - }); - +function buildParser(src) { + + var xhr = new XMLHttpRequest(); + xhr.open('GET', src + '?' + +new Date, false); + xhr.send(null); + var parserCode = xhr.responseText; + + siml.PARSER = PEG.buildParser(parserCode, { + cache: false, + trackLineAndColumn: true + }); + } \ No newline at end of file diff --git a/test/resources/html-lab.html b/test/resources/html-lab.html index 5211284..f8336dd 100644 --- a/test/resources/html-lab.html +++ b/test/resources/html-lab.html @@ -1,47 +1,47 @@ - - - - - JH LAB - - - - - - - - - - - - - - - - + + + + + JH LAB + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/resources/lab.html b/test/resources/lab.html index a2c8b6d..822cf0b 100644 --- a/test/resources/lab.html +++ b/test/resources/lab.html @@ -1,39 +1,39 @@ - - - - - JH LAB - - - - - - - - - - - - - - - - + + + + + JH LAB + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/resources/live-parser.html b/test/resources/live-parser.html index 90bd2f5..81272d1 100644 --- a/test/resources/live-parser.html +++ b/test/resources/live-parser.html @@ -1,182 +1,182 @@ - - - - - SIML -- Try it out! - - - - - - -
-
-
- -
- - -html - head - meta - title - body - section - h1 'ok' - p ( - 'a'/'b' - ) - -
-
-

-		
-
- - - - - - - - - - - - + + + + + SIML -- Try it out! + + + + + + +
+
+
+ +
+ + +html + head + meta + title + body + section + h1 'ok' + p ( + 'a'/'b' + ) + +
+
+

+		
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/test/resources/specHelpers.js b/test/resources/specHelpers.js index 70a55de..f85b178 100644 --- a/test/resources/specHelpers.js +++ b/test/resources/specHelpers.js @@ -1,7 +1,7 @@ -beforeEach(function() { - this.addMatchers({ - toGenerate: function(expected) { - return siml.parse(this.actual, {pretty:false}) === expected; - } - }); +beforeEach(function() { + this.addMatchers({ + toGenerate: function(expected) { + return siml.parse(this.actual, {pretty:false}) === expected; + } + }); }); \ No newline at end of file