Skip to content

Commit

Permalink
Add tests for Textile
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Sep 6, 2015
1 parent 93964dd commit 78890e4
Show file tree
Hide file tree
Showing 11 changed files with 814 additions and 0 deletions.
117 changes: 117 additions & 0 deletions tests/languages/css+textile/css_inclusion.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
h3{color: red}. Baz

h4[fr]{text-decoration:underline;}(#bar). Foobar

*{color:red}bold*
"(foo)[en]{color:blue;}Foo":bar

#[fr](#foo){background:pink} Foobar

!(foo)[en]{border:1px solid #ccc}foo.png!

{color: blue}.|{font-weight:bold}.Baz|
(foo#bar){font-style:italic}[fr].|{background:red;}(bar#baz)[en].Baz|

----------------------------------------------------

[
["phrase", [
["block-tag", [
["tag", "h3"],
["modifier", [
["css", [["punctuation", "{"], ["property", "color"], ["punctuation", ":"], " red", ["punctuation", "}"]]]
]],
["punctuation", "."]
]],
" Baz"
]],
["phrase", [
["block-tag", [
["tag", "h4"],
["modifier", [
["punctuation", "["], ["lang", "fr"], ["punctuation", "]"],
["css", [["punctuation", "{"], ["property", "text-decoration"], ["punctuation", ":"], "underline", ["punctuation", ";"], ["punctuation", "}"]]],
["punctuation", "("], ["class-id", "#bar"], ["punctuation", ")"]
]],
["punctuation", "."]
]],
" Foobar"
]],

["phrase", [
["inline", [
["punctuation", "*"],
["modifier", [
["css", [["punctuation", "{"], ["property", "color"], ["punctuation", ":"], "red", ["punctuation", "}"]]]
]],
["bold", ["bold"]],
["punctuation", "*"]
]],
["link", [
["punctuation", "\""],
["modifier", [
["punctuation", "("], ["class-id", "foo"], ["punctuation", ")"],
["punctuation", "["], ["lang", "en"], ["punctuation", "]"],
["css", [["punctuation", "{"], ["property", "color"], ["punctuation", ":"], "blue", ["punctuation", ";"], ["punctuation", "}"]]]
]],
["text", "Foo"],
["punctuation", "\""], ["punctuation", ":"],
["url", "bar"]
]]
]],

["phrase", [
["list", [
["punctuation", "#"],
["modifier", [
["punctuation", "["], ["lang", "fr"], ["punctuation", "]"],
["punctuation", "("], ["class-id", "#foo"], ["punctuation", ")"],
["css", [["punctuation", "{"], ["property", "background"], ["punctuation", ":"], "pink", ["punctuation", "}"]]]
]],
" Foobar"
]]
]],

["phrase", [
["image", [
["punctuation", "!"],
["modifier", [
["punctuation", "("], ["class-id", "foo"], ["punctuation", ")"],
["punctuation", "["], ["lang", "en"], ["punctuation", "]"],
["css", [["punctuation", "{"], ["property", "border"], ["punctuation", ":"], "1px solid #ccc", ["punctuation", "}"]]]
]],
["source", "foo.png"],
["punctuation", "!"]
]]
]],

["phrase", [
["table", [
["modifier", [
["css", [["punctuation", "{"], ["property", "color"], ["punctuation", ":"], " blue", ["punctuation", "}"]]]
]],
["punctuation", "."], ["punctuation", "|"],
["modifier", [
["css", [["punctuation", "{"], ["property", "font-weight"], ["punctuation", ":"], "bold", ["punctuation", "}"]]]
]],
["punctuation", "."], "Baz", ["punctuation", "|"],

["modifier", [
["punctuation", "("], ["class-id", "foo#bar"], ["punctuation", ")"],
["css", [["punctuation", "{"], ["property", "font-style"], ["punctuation", ":"], "italic", ["punctuation", "}"]]],
["punctuation", "["], ["lang", "fr"], ["punctuation", "]"]
]],
["punctuation", "."], ["punctuation", "|"],
["modifier", [
["css", [["punctuation", "{"], ["property", "background"], ["punctuation", ":"], "red", ["punctuation", ";"], ["punctuation", "}"]]],
["punctuation", "("], ["class-id", "bar#baz"], ["punctuation", ")"],
["punctuation", "["], ["lang", "en"], ["punctuation", "]"]
]],
["punctuation", "."], "Baz", ["punctuation", "|"]
]]
]]
]

----------------------------------------------------

Checks for CSS modifier.
15 changes: 15 additions & 0 deletions tests/languages/textile/acronym_feature.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CSS(Cascading Style Sheet)
HTML(HyperText Markup Language)

----------------------------------------------------

[
["phrase", [
["acronym", ["CSS", ["punctuation", "("], ["comment", "Cascading Style Sheet"], ["punctuation", ")"]]],
["acronym", ["HTML", ["punctuation", "("], ["comment", "HyperText Markup Language"], ["punctuation", ")"]]]
]]
]

----------------------------------------------------

Checks for acronyms.
131 changes: 131 additions & 0 deletions tests/languages/textile/block-tag_feature.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
h1. Header 1

h2>. Header 2

bq. A block quotation

p<. Foo

p=. Bar

p<>. Baz

p(. Foobar
baz

p))). Foo

h1(foo). Foo

h2[en]. Bar

h3{color: red}. Baz

h4[fr]{text-decoration:underline;}(#bar). Foobar

----------------------------------------------------

[
["phrase", [
["block-tag", [["tag", "h1"], ["punctuation", "."]]],
" Header 1"
]],
["phrase", [
["block-tag", [
["tag", "h2"],
["modifier", [["punctuation", ">"]]],
["punctuation", "."]
]],
" Header 2"
]],
["phrase", [
["block-tag", [["tag", "bq"], ["punctuation", "."]]],
" A block quotation"
]],
["phrase", [
["block-tag", [
["tag", "p"],
["modifier", [["punctuation", "<"]]],
["punctuation", "."]
]],
" Foo"
]],
["phrase", [
["block-tag", [
["tag", "p"],
["modifier", [["punctuation", "="]]],
["punctuation", "."]
]],
" Bar"
]],
["phrase", [
["block-tag", [
["tag", "p"],
["modifier", [["punctuation", "<"], ["punctuation", ">"]]],
["punctuation", "."]
]],
" Baz"
]],
["phrase", [
["block-tag", [
["tag", "p"],
["modifier", [["punctuation", "("]]],
["punctuation", "."]
]],
" Foobar\r\nbaz"
]],
["phrase", [
["block-tag", [
["tag", "p"],
["modifier", [["punctuation", ")"], ["punctuation", ")"], ["punctuation", ")"]]],
["punctuation", "."]
]],
" Foo"
]],
["phrase", [
["block-tag", [
["tag", "h1"],
["modifier", [
["punctuation", "("], ["class-id", "foo"], ["punctuation", ")"]
]],
["punctuation", "."]
]],
" Foo"
]],
["phrase", [
["block-tag", [
["tag", "h2"],
["modifier", [
["punctuation", "["], ["lang", "en"], ["punctuation", "]"]
]],
["punctuation", "."]
]],
" Bar"
]],
["phrase", [
["block-tag", [
["tag", "h3"],
["modifier", [
["css", ["{color: red}"]]
]],
["punctuation", "."]
]],
" Baz"
]],
["phrase", [
["block-tag", [
["tag", "h4"],
["modifier", [
["punctuation", "["], ["lang", "fr"], ["punctuation", "]"],
["css", ["{text-decoration:underline;}"]],
["punctuation", "("], ["class-id", "#bar"], ["punctuation", ")"]
]],
["punctuation", "."]
]],
" Foobar"
]]
]

----------------------------------------------------

Checks for tags at the beginning of a block and alignment modifiers.
15 changes: 15 additions & 0 deletions tests/languages/textile/footnote_feature.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Foo[1]
Bar[42]

----------------------------------------------------

[
["phrase", [
"Foo", ["footnote", [["punctuation", "["], "1", ["punctuation", "]"]]],
"\r\nBar", ["footnote", [["punctuation", "["], "42", ["punctuation", "]"]]]
]]
]

----------------------------------------------------

Checks for footnotes.
71 changes: 71 additions & 0 deletions tests/languages/textile/image_feature.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
!foo.png!
!bar.jpg(Foo bar)!
!foo.png!:http://prismjs.com
!bar.jpg(Foo bar)!:http://www.example.com

!<foo.png! !>bar.jpg!
!(foo)[en]{border:1px solid #ccc}foo.png!

----------------------------------------------------

[
["phrase", [
["image", [
["punctuation", "!"],
["source", "foo.png"],
["punctuation", "!"]
]],
["image", [
["punctuation", "!"],
["source", "bar.jpg(Foo bar)"],
["punctuation", "!"]
]],
["image", [
["punctuation", "!"],
["source", "foo.png"],
["punctuation", "!"],
["punctuation", ":"],
["url", "http://prismjs.com"]
]],
["image", [
["punctuation", "!"],
["source", "bar.jpg(Foo bar)"],
["punctuation", "!"],
["punctuation", ":"],
["url", "http://www.example.com"]
]]
]],

["phrase", [
["image", [
["punctuation", "!"],
["modifier", [
["punctuation", "<"]
]],
["source", "foo.png"],
["punctuation", "!"]
]],
["image", [
["punctuation", "!"],
["modifier", [
["punctuation", ">"]
]],
["source", "bar.jpg"],
["punctuation", "!"]
]],
["image", [
["punctuation", "!"],
["modifier", [
["punctuation", "("], ["class-id", "foo"], ["punctuation", ")"],
["punctuation", "["], ["lang", "en"], ["punctuation", "]"],
["css", ["{border:1px solid #ccc}"]]
]],
["source", "foo.png"],
["punctuation", "!"]
]]
]]
]

----------------------------------------------------

Checks for images.
Loading

0 comments on commit 78890e4

Please sign in to comment.