tests/test_files/inline_05_Superscript.R

context("Superscript")

test_that("Superscript", {

    ## Test Superscript with Header
    x <- pandocfilters:::test(list(Header(list(Superscript(list(Str("Hello R!")))))))
    expect_that(x, equals("<h1><sup>Hello R!</sup></h1>"))
    x <- pandocfilters:::test(list(Header(list(Superscript(Str("Hello R!"))))))
    expect_that(x, equals("<h1><sup>Hello R!</sup></h1>"))
    x <- pandocfilters:::test(list(Header(Superscript(Str("Hello R!")))))
    expect_that(x, equals("<h1><sup>Hello R!</sup></h1>"))   

    ## Test Superscript with Plain
    x <- pandocfilters:::test(list(Plain(list(Superscript(list(Str("Hello R!")))))))
    expect_that(x, equals("<sup>Hello R!</sup>"))
    x <- pandocfilters:::test(list(Plain(list(Superscript(Str("Hello R!"))))))
    expect_that(x, equals("<sup>Hello R!</sup>"))
    x <- pandocfilters:::test(list(Plain(Superscript(Str("Hello R!")))))
    expect_that(x, equals("<sup>Hello R!</sup>"))
    
} )

Try the pandocfilters package in your browser

Any scripts or data that you put into this service are public.

pandocfilters documentation built on Aug. 12, 2022, 1:05 a.m.