Просмотр исходного кода

reverted all tests back from ridiculous attempt to adjust. need to just ignore whitespace in tests for now.

parser-rewrite
nathan@stravinsky.local 16 лет назад
Родитель
Сommit
e1f7e3c606
28 измененных файлов: 50 добавлений и 58 удалений
  1. +1
    -1
      examples/array_of_partials_implicit_partial.2.html
  2. +3
    -1
      examples/array_of_partials_implicit_partial.html
  3. +0
    -1
      examples/array_of_partials_implicit_partial.txt
  4. +1
    -1
      examples/array_of_partials_partial.2.html
  5. +3
    -2
      examples/array_of_partials_partial.html
  6. +0
    -1
      examples/array_of_partials_partial.txt
  7. +2
    -1
      examples/array_of_strings.html
  8. +1
    -1
      examples/array_of_strings.txt
  9. +2
    -1
      examples/array_of_strings_options.html
  10. +1
    -1
      examples/array_of_strings_options.txt
  11. +13
    -5
      examples/complex.html
  12. +3
    -10
      examples/complex.txt
  13. +1
    -3
      examples/delimiters.txt
  14. +1
    -1
      examples/empty_partial.html
  15. +1
    -1
      examples/empty_template.txt
  16. +1
    -0
      examples/error_not_found.txt
  17. +0
    -1
      examples/inverted_section.txt
  18. +2
    -2
      examples/recursion_with_same_names.html
  19. +0
    -3
      examples/recursion_with_same_names.txt
  20. +3
    -3
      examples/reuse_of_enumerables.html
  21. +0
    -5
      examples/reuse_of_enumerables.txt
  22. +4
    -3
      examples/section_as_context.html
  23. +1
    -3
      examples/section_as_context.txt
  24. +0
    -1
      examples/simple.txt
  25. +1
    -1
      examples/two_in_a_row.txt
  26. +1
    -1
      examples/unescaped.txt
  27. +1
    -1
      examples/unknown_pragma.txt
  28. +3
    -3
      test/mustache_spec.rb

+ 1
- 1
examples/array_of_partials_implicit_partial.2.html Просмотреть файл

@@ -1 +1 @@
{{.}}
{{.}}

+ 3
- 1
examples/array_of_partials_implicit_partial.html Просмотреть файл

@@ -1,3 +1,5 @@
Here is some stuff!
{{%IMPLICIT-ITERATOR}}
{{#numbers}}{{>partial}}{{/numbers}}
{{#numbers}}
{{>partial}}
{{/numbers}}

+ 0
- 1
examples/array_of_partials_implicit_partial.txt Просмотреть файл

@@ -1,5 +1,4 @@
Here is some stuff!

1
2
3


+ 1
- 1
examples/array_of_partials_partial.2.html Просмотреть файл

@@ -1 +1 @@
{{i}}
{{i}}

+ 3
- 2
examples/array_of_partials_partial.html Просмотреть файл

@@ -1,3 +1,4 @@
Here is some stuff!
{{#numbers}}{{>partial}}
{{/numbers}}
{{#numbers}}
{{>partial}}
{{/numbers}}

+ 0
- 1
examples/array_of_partials_partial.txt Просмотреть файл

@@ -3,4 +3,3 @@ Here is some stuff!
2
3
4


+ 2
- 1
examples/array_of_strings.html Просмотреть файл

@@ -1 +1,2 @@
{{%IMPLICIT-ITERATOR}}{{#array_of_strings}}{{.}} {{/array_of_strings}}
{{%IMPLICIT-ITERATOR}}
{{#array_of_strings}} {{.}} {{/array_of_strings}}

+ 1
- 1
examples/array_of_strings.txt Просмотреть файл

@@ -1 +1 @@
hello world
hello world

+ 2
- 1
examples/array_of_strings_options.html Просмотреть файл

@@ -1 +1,2 @@
{{%IMPLICIT-ITERATOR iterator=rob}}{{#array_of_strings_options}}{{rob}} {{/array_of_strings_options}}
{{%IMPLICIT-ITERATOR iterator=rob}}
{{#array_of_strings_options}} {{rob}} {{/array_of_strings_options}}

+ 1
- 1
examples/array_of_strings_options.txt Просмотреть файл

@@ -1 +1 @@
hello world
hello world

+ 13
- 5
examples/complex.html Просмотреть файл

@@ -1,8 +1,16 @@
<h1>{{header}}</h1>
{{#list}}
<ul>{{#item}}
{{#current}}<li><strong>{{name}}</strong></li>{{/current}}
{{#link}}<li><a href="{{url}}">{{name}}</a></li>{{/link}}
{{/item}}</ul>
<ul>
{{#item}}
{{#current}}
<li><strong>{{name}}</strong></li>
{{/current}}
{{#link}}
<li><a href="{{url}}">{{name}}</a></li>
{{/link}}
{{/item}}
</ul>
{{/list}}
{{#empty}}<p>The list is empty.</p>{{/empty}}
{{#empty}}
<p>The list is empty.</p>
{{/empty}}

+ 3
- 10
examples/complex.txt Просмотреть файл

@@ -1,13 +1,6 @@
<h1>Colors</h1>

<ul>
<li><strong>red</strong></li>
<ul>
<li><strong>red</strong></li>
<li><a href="#Green">green</a></li>
<li><a href="#Blue">blue</a></li>
</ul>

</ul>

+ 1
- 3
examples/delimiters.txt Просмотреть файл

@@ -1,7 +1,5 @@
*
It worked the first time.
* And it worked the second time.

* Then, surprisingly, it worked the third time.

* Fourth time also fine!.
* Fourth time also fine!.

+ 1
- 1
examples/empty_partial.html Просмотреть файл

@@ -1,2 +1,2 @@
hey {{foo}}
{{>partial}}
{{>partial}}

+ 1
- 1
examples/empty_template.txt Просмотреть файл

@@ -1 +1 @@
<html><head></head><body><h1>Test</h1></body></html>
<html><head></head><body><h1>Test</h1></body></html>

+ 1
- 0
examples/error_not_found.txt Просмотреть файл

@@ -0,0 +1 @@


+ 0
- 1
examples/inverted_section.txt Просмотреть файл

@@ -1,2 +1 @@

No repos :(

+ 2
- 2
examples/recursion_with_same_names.html Просмотреть файл

@@ -2,6 +2,6 @@
{{ description }}

{{#terms}}
{{name}}
{{name}}
{{index}}
{{/terms}}
{{/terms}}

+ 0
- 3
examples/recursion_with_same_names.txt Просмотреть файл

@@ -1,9 +1,6 @@
name
desc


t1
0

t2
1

+ 3
- 3
examples/reuse_of_enumerables.html Просмотреть файл

@@ -1,8 +1,8 @@
{{#terms}}
{{name}}
{{name}}
{{index}}
{{/terms}}
{{#terms}}
{{name}}
{{name}}
{{index}}
{{/terms}}
{{/terms}}

+ 0
- 5
examples/reuse_of_enumerables.txt Просмотреть файл

@@ -1,13 +1,8 @@

t1
0

t2
1


t1
0

t2
1

+ 4
- 3
examples/section_as_context.html Просмотреть файл

@@ -1,8 +1,9 @@
{{#a_object}}
<h1>{{title}}</h1>
<h1>{{title}}</h1>
<p>{{description}}</p>
<ul>
{{#a_list}}<li>{{label}}</li>
{{#a_list}}
<li>{{label}}</li>
{{/a_list}}
</ul>
{{/a_object}}
{{/a_object}}

+ 1
- 3
examples/section_as_context.txt Просмотреть файл

@@ -1,8 +1,6 @@

<h1>this is an object</h1>
<p>one of its attributes is a list</p>
<ul>
<li>listitem1</li>
<li>listitem2</li>
</ul>
</ul>

+ 0
- 1
examples/simple.txt Просмотреть файл

@@ -1,4 +1,3 @@
Hello Chris
You have just won $10000!

Well, $6000, after taxes.

+ 1
- 1
examples/two_in_a_row.txt Просмотреть файл

@@ -1 +1 @@
Welcome, Joe!
Welcome, Joe!

+ 1
- 1
examples/unescaped.txt Просмотреть файл

@@ -1 +1 @@
<h1>Bear > Shark</h1>
<h1>Bear > Shark</h1>

+ 1
- 1
examples/unknown_pragma.txt Просмотреть файл

@@ -1 +1 @@
ERROR: This mustache implementation doesn't understand the 'I-HAVE-THE-GREATEST-MUSTACHE' pragma
ERROR: This implementation of mustache doesn't understand the 'I-HAVE-THE-GREATEST-MUSTACHE' pragma

+ 3
- 3
test/mustache_spec.rb Просмотреть файл

@@ -68,7 +68,7 @@ describe "mustache" do
}
JS

run_js(runner).should == expect + "\n"
run_js(runner).should == expect
end
it "should sendFun the correct html" do

@@ -86,7 +86,7 @@ describe "mustache" do
}
var template = #{template};
Mustache.to_html(template, #{testname}, null, sendFun);
print(chunks.join(""));
print(chunks.join("\\n"));
} catch(e) {
print('ERROR: ' + e.message);
}
@@ -137,7 +137,7 @@ describe "mustache" do
}
}
Mustache.to_html(template, partial_context, partials, sendFun);
print(chunks.join(""));
print(chunks.join("\\n"));
} catch(e) {
print('ERROR: ' + e.message);
}


Загрузка…
Отмена
Сохранить