tests/testthat/test-dc_typology.R

context("Checking dc_typology")

library("qdap")

test_that("typology returns a list of counts, negatives and positives of the correct classes",{

    out <- with(pres_debates2012[1:200, ], dc_typology(dialogue, person))


    cls <- structure(list(counts = "termco", positive = c("qdap_context", 
        "data.frame"), negative = c("qdap_context", "data.frame")), .Names = c("counts", 
        "positive", "negative"))
    
    expect_true(is.list(out))
    expect_equal(names(out), c("counts", "positive", "negative"))
    
    expect_equal(sapply(out, class), cls)
})
trinker/discon documentation built on May 31, 2019, 8:42 p.m.