Skip to content

Commit

Permalink
Add ini/toml tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed May 28, 2019
1 parent dc8906d commit f791e70
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/markup/ini/comments.expect.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<span class="hljs-comment"># Comment</span>
<span class="hljs-comment">; ini-style comment</span>
<span class="hljs-attr">x</span> = <span class="hljs-string">"abc"</span> <span class="hljs-comment"># Comment on same line</span>
<span class="hljs-attr">y</span> = <span class="hljs-number">123</span> <span class="hljs-comment">; Comment on same line</span>
<span class="hljs-section">[table]</span> <span class="hljs-comment">; Comment on same line</span>
5 changes: 5 additions & 0 deletions test/markup/ini/comments.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Comment
; ini-style comment
x = "abc" # Comment on same line
y = 123 ; Comment on same line
[table] ; Comment on same line
4 changes: 4 additions & 0 deletions test/markup/ini/tables.expect.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<span class="hljs-section">[table]</span>
<span class="hljs-section">[[array]]</span>
<span class="hljs-section">[dotted.table.name]</span>
<span class="hljs-section">[target.'cfg(unix)']</span>
4 changes: 4 additions & 0 deletions test/markup/ini/tables.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[table]
[[array]]
[dotted.table.name]
[target.'cfg(unix)']
20 changes: 20 additions & 0 deletions test/markup/ini/types.expect.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<span class="hljs-attr">i</span> = <span class="hljs-number">1_234</span>
<span class="hljs-attr">f</span> = <span class="hljs-number">1.23</span>
<span class="hljs-attr">f</span> = <span class="hljs-number">7</span>e+<span class="hljs-number">12</span>
<span class="hljs-attr">f</span> = <span class="hljs-number">2</span>e3
<span class="hljs-attr">f</span> = -<span class="hljs-number">1.234</span>e-<span class="hljs-number">12</span>
<span class="hljs-attr">basic</span> = <span class="hljs-string">"string"</span>
<span class="hljs-attr">multi_basic</span> = <span class="hljs-string">"""multiple
lines"""</span>
<span class="hljs-attr">literal</span> = <span class="hljs-string">'string'</span>
<span class="hljs-attr">multi_literal</span> = <span class="hljs-string">'''multiple
lines'''</span>
<span class="hljs-attr">b</span> = <span class="hljs-literal">true</span>
<span class="hljs-attr">b</span> = <span class="hljs-literal">false</span>
<span class="hljs-attr">b</span> = <span class="hljs-literal">on</span>
<span class="hljs-attr">b</span> = <span class="hljs-literal">off</span>
<span class="hljs-attr">b</span> = <span class="hljs-literal">yes</span>
<span class="hljs-attr">b</span> = <span class="hljs-literal">no</span>
<span class="hljs-attr">dotted.key</span> = <span class="hljs-number">1</span>
<span class="hljs-attr">array</span> = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>]
<span class="hljs-attr">inline</span> = {name = <span class="hljs-string">"foo"</span>, id = <span class="hljs-number">123</span>}
20 changes: 20 additions & 0 deletions test/markup/ini/types.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
i = 1_234
f = 1.23
f = 7e+12
f = 2e3
f = -1.234e-12
basic = "string"
multi_basic = """multiple
lines"""
literal = 'string'
multi_literal = '''multiple
lines'''
b = true
b = false
b = on
b = off
b = yes
b = no
dotted.key = 1
array = [1, 2, 3]
inline = {name = "foo", id = 123}
2 changes: 2 additions & 0 deletions test/markup/ini/variable.expect.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<span class="hljs-attr">memory_limit</span> = <span class="hljs-variable">${PHP_MEMORY_LIMIT}</span>
<span class="hljs-attr">key</span> = <span class="hljs-variable">$VAR1</span>
2 changes: 2 additions & 0 deletions test/markup/ini/variable.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
memory_limit = ${PHP_MEMORY_LIMIT}
key = $VAR1

0 comments on commit f791e70

Please sign in to comment.