Skip to content

Commit

Permalink
fixed unit tests for get_trackdata(resultType = "tibble") default
Browse files Browse the repository at this point in the history
  • Loading branch information
raphywink committed Mar 15, 2019
1 parent 73181ba commit e0c8e91
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: emuR
Version: 1.9.9.9003
Version: 1.9.9.9001
Title: Main Package of the EMU Speech Database Management System
Authors@R: c(
person("Raphael", "Winkelmann", , "[email protected]", c("aut", "cre")),
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# emuR 1.9.9.9000
# emuR 1.9.9.9001

## new features / performance tweaks / improvements

Expand All @@ -7,6 +7,7 @@
* `serve()` doesn't block the R console any more
* suppressing requery differing length warnings in `runBASwebservice_*` functions
* `requery_hier()` now persists the input segment list length by inserting NA rows for missing segments
* depricated vignettes are now stubs only (== empty containing notice pointing to the EMU-SDMS manual)

## bug fixes

Expand Down
4 changes: 3 additions & 1 deletion tests/testthat/test_emuR-emuRtrackdata.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ test_that("emuRtrackdata functions work", {
##############################
test_that("correct classes are returned", {

sl = query(ae, "Phonetic == @ | i:")
sl = query(ae, "Phonetic == @ | i:",
resultType = "emuRsegs")
td = get_trackdata(ae,
seglist = sl,
ssffTrackName = 'fm',
resultType = "trackdata",
verbose = F)

newTd = create_emuRtrackdata(sl, td)
Expand Down
15 changes: 15 additions & 0 deletions tests/testthat/test_emuR-get_trackdata.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ test_that("correct classes are returned", {
n,
'fm',
consistentOutputType = F,
resultType = "trackdata",
verbose = F)
expect_that(class(td), equals('trackdata'))

td = get_trackdata(ae,
n,
'fm',
cut = .5,
resultType = "trackdata",
consistentOutputType = F,
verbose = F)
expect_that(class(td), equals('data.frame'))
Expand All @@ -55,6 +57,7 @@ test_that("correct classes are returned", {
'fm',
cut = .5,
npoints = 3,
resultType = "trackdata",
consistentOutputType = F,
verbose = F)
expect_that(class(td),
Expand All @@ -65,13 +68,15 @@ test_that("correct classes are returned", {
'fm',
cut = .5,
npoints = 1,
resultType = "trackdata",
consistentOutputType = F,
verbose = F)
expect_that(class(td), equals('data.frame'))

td = get_trackdata(ae,
hStar,
'fm',
resultType = "trackdata",
consistentOutputType = F,
verbose = F)
expect_that(class(td), equals('data.frame'))
Expand All @@ -80,6 +85,7 @@ test_that("correct classes are returned", {
hStar,
'fm',
npoints = 3,
resultType = "trackdata",
consistentOutputType = F,
verbose = F)
expect_that(class(td), equals('trackdata'))
Expand Down Expand Up @@ -139,6 +145,7 @@ test_that("correct classes are returned", {
'fm',
cut = .5,
npoints = 3,
resultType = "trackdata",
verbose = F)
expect_that(dim(td$data)[1], equals(length(n$utts)*3))

Expand All @@ -147,6 +154,7 @@ test_that("correct classes are returned", {
'fm',
cut = .5,
npoints = 5,
resultType = "trackdata",
verbose = F)
expect_that(dim(td$data)[1], equals(length(n$utts)*5))

Expand All @@ -161,6 +169,7 @@ test_that("correct classes are returned", {
'fm',
cut = cutV,
consistentOutputType = F,
resultType = "trackdata",
verbose = F)
expect_that(class(td), equals('data.frame'))
}
Expand All @@ -174,6 +183,7 @@ test_that("correct classes are returned", {
'fm',
cut = 0.5,
npoints = 20,
resultType = "trackdata",
verbose = F)
expect_that(class(td), equals('trackdata'))
})
Expand All @@ -188,6 +198,7 @@ test_that("correct classes are returned", {
n,
wrasspOutputInfos[[wrasspFun]]$tracks[1],
onTheFlyFunctionName = wrasspFun,
resultType = "trackdata",
verbose = F)
}
expect_that(class(td), equals('trackdata'))
Expand All @@ -199,6 +210,7 @@ test_that("correct classes are returned", {
td = get_trackdata(ae,
n,
onTheFlyFunctionName = "ksvF0",
resultType = "trackdata",
verbose = F)
expect_equal(dim(td$index)[1], 12)
})
Expand All @@ -209,6 +221,7 @@ test_that("correct classes are returned", {
td = get_trackdata(ae,
n,
'fm',
resultType = "trackdata",
verbose = F)
expect_that(td$data[10,1], equals(256))
expect_that(td$data[10,2], equals(1521))
Expand All @@ -218,6 +231,7 @@ test_that("correct classes are returned", {
td = get_trackdata(ae,
n,
onTheFlyFunctionName = "forest",
resultType = "trackdata",
verbose = F)
expect_that(td$data[10,1], equals(256))
expect_that(td$data[10,2], equals(1521))
Expand All @@ -235,6 +249,7 @@ test_that("correct classes are returned", {
td = get_trackdata(ae,
sl,
onTheFlyFunctionName = "ksvF0",
resultType = "trackdata",
verbose = F)
expect_equal(dim(td$index)[1], 12)
})
Expand Down

0 comments on commit e0c8e91

Please sign in to comment.