aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-08-10 12:04:08 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2017-08-10 15:01:14 -0700
commitdee4cbc8549d782d9c3f2e9072b2c141ea4f18ad (patch)
treeacc5eb2c01d99c0cea75e2493ff51f09e7916351 /test
parenta5790dd30893cf7143eb64a46fb137caf131a624 (diff)
downloadpandoc-dee4cbc8549d782d9c3f2e9072b2c141ea4f18ad.tar.gz
RST reader: implement csv-table directive.
Most attributes are supported, including `:file:` and `:url:`. A (probably insufficient) test case has been added. Closes #3533.
Diffstat (limited to 'test')
-rw-r--r--test/command/3533-rst-csv-tables.csv4
-rw-r--r--test/command/3533-rst-csv-tables.md55
2 files changed, 59 insertions, 0 deletions
diff --git a/test/command/3533-rst-csv-tables.csv b/test/command/3533-rst-csv-tables.csv
new file mode 100644
index 000000000..efef5e4d5
--- /dev/null
+++ b/test/command/3533-rst-csv-tables.csv
@@ -0,0 +1,4 @@
+"Albatross", 2.99, "On a stick!"
+"Crunchy Frog", 1.49, "If we took the bones out, it wouldn't be
+crunchy, now would it?"
+
diff --git a/test/command/3533-rst-csv-tables.md b/test/command/3533-rst-csv-tables.md
new file mode 100644
index 000000000..0e6ed4fea
--- /dev/null
+++ b/test/command/3533-rst-csv-tables.md
@@ -0,0 +1,55 @@
+```
+% pandoc -f rst -t native
+.. csv-table:: Test
+ :widths: 10, 5, 10
+ :header: Flavor,Price,Slogan
+ :file: command/3533-rst-csv-tables.csv
+^D
+[Table [Str "Test"] [AlignDefault,AlignDefault,AlignDefault] [0.4,0.2,0.4]
+ [[Plain [Str "Flavor"]]
+ ,[Plain [Str "Price"]]
+ ,[Plain [Str "Slogan"]]]
+ [[[Plain [Str "Albatross"]]
+ ,[Plain [Str "2.99"]]
+ ,[Plain [Str "On",Space,Str "a",Space,Str "stick!"]]]
+ ,[[Plain [Str "Crunchy",Space,Str "Frog"]]
+ ,[Plain [Str "1.49"]]
+ ,[Plain [Str "If",Space,Str "we",Space,Str "took",Space,Str "the",Space,Str "bones",Space,Str "out,",Space,Str "it",Space,Str "wouldn't",Space,Str "be",SoftBreak,Str "crunchy,",Space,Str "now",Space,Str "would",Space,Str "it?"]]]]]
+```
+
+```
+% pandoc -f rst -t native
+.. csv-table:: Test
+ :header-rows: 1
+ :quote: '
+ :delim: space
+
+ '' 'a' 'b'
+ 'cat''s' 3 4
+ 'dog''s' 2 3
+^D
+[Table [Str "Test"] [AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0]
+ [[]
+ ,[Plain [Str "a"]]
+ ,[Plain [Str "b"]]]
+ [[[Plain [Str "cat's"]]
+ ,[Plain [Str "3"]]
+ ,[Plain [Str "4"]]]
+ ,[[Plain [Str "dog's"]]
+ ,[Plain [Str "2"]]
+ ,[Plain [Str "3"]]]]]
+```
+
+```
+% pandoc -f rst -t native
+.. csv-table:: Test
+ :escape: \
+
+ "1","\""
+^D
+[Table [Str "Test"] [AlignDefault,AlignDefault] [0.0,0.0]
+ []
+ [[[Plain [Str "1"]]
+ ,[Plain [Str "\""]]]]]
+```
+