blob: c53a50dc35f5feec537a5a517e0462f66a83df01 [file] [log] [blame]
Christophe Dervieux2f01dc92021-09-22 09:37:18 +02001test_that("reveal options are passed as pandoc variables", {
2 expect_equal(process_reveal_option("a", "b"), pandoc_variable_arg("a", "b"))
3})
4
5test_that("reveal options with boolean are transformed to JS bool", {
6 expect_equal(process_reveal_option("a", TRUE), pandoc_variable_arg("a", "true"))
7 expect_equal(process_reveal_option("a", FALSE), pandoc_variable_arg("a", "false"))
8})
9
10test_that("reveal options slideNumbers is treated specifically", {
11 expect_equal(process_reveal_option("slideNumber", "c/t"), pandoc_variable_arg("slideNumber", "'c/t'"))
12 expect_equal(process_reveal_option("slideNumber", TRUE), pandoc_variable_arg("slideNumber", "true"))
13})
14
15test_that("reveal options width / heigh in % are quoted", {
16 expect_equal(process_reveal_option("width", "50%"), pandoc_variable_arg("width", "'50%'"))
17 expect_equal(process_reveal_option("height", "50%"), pandoc_variable_arg("height", "'50%'"))
18 expect_equal(process_reveal_option("width", 5), pandoc_variable_arg("width", "5"))
19 expect_equal(process_reveal_option("height", 5), pandoc_variable_arg("height", "5"))
20})
21
22test_that("reveal options for chalkboard plugins special handling", {
23 expect_equal(process_reveal_option("chalkboard-background", "rgba(255,255,255,0.5)"), pandoc_variable_arg("chalkboard-background", "['rgba(255,255,255,0.5)']"))
24 expect_equal(process_reveal_option("chalkboard-color", c("a", "b")), pandoc_variable_arg("chalkboard-color", "['a', 'b']"))
25 expect_equal(process_reveal_option("chalkboard-draw", c("a", "b")), pandoc_variable_arg("chalkboard-draw", "['a', 'b']"))
26 expect_equal(process_reveal_option("chalkboard-pen", c("a", "b")), pandoc_variable_arg("chalkboard-pen", "['a', 'b']"))
27 expect_equal(process_reveal_option("chalkboard-other", "dummy"), pandoc_variable_arg("chalkboard-other", "dummy"))
28})
29