Skip to content

Commit

Permalink
Added tests folder and travis config
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxneticien committed Feb 12, 2018
1 parent 5925cdb commit 6633103
Show file tree
Hide file tree
Showing 14 changed files with 118 additions and 26 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
^README\.Rmd$
^README-.*\.png$
^docs$
^_pkgdown\.yml$
^\.travis\.yml$
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r

language: R
sudo: false
cache: packages
8 changes: 6 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ Imports:
tidyr,
zoo
RoxygenNote: 6.0.1
Suggests: knitr,
rmarkdown
URL: https://github.com/coedl/tidylex
BugReports: https://github.com/coedl/tidylex/issues
Suggests:
knitr,
rmarkdown,
testthat
VignetteBuilder: knitr
9 changes: 9 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
url: https://coedl.github.io/tidylex

authors:
Nay San:
href: https://resunay.com

template:
params:
bootswatch: cerulean
11 changes: 8 additions & 3 deletions docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions docs/articles/tidylex.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 20 additions & 5 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions docs/pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
urls:
reference: https://coedl.github.io/tidylex/reference
article: https://coedl.github.io/tidylex/articles
articles:
tidylex: tidylex.html

11 changes: 8 additions & 3 deletions docs/reference/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions docs/reference/read_lexicon.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
library(testthat)
library(tidylex)

test_check("tidylex")
15 changes: 15 additions & 0 deletions tests/testthat/test-read_lexicon.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
context("read_lexicon")

test_that("can read mini French lexicon", {
check_df <- tibble(
line = 1:5,
data = c("\\lx bonjour", "\\de hello", "", "\\lx au revoir", "\\de goodbye")
)

test_file <- system.file("extdata", "mini-french.txt", package = "tidylex")

expect_identical(
read_lexicon(file = test_file),
check_df
)
})

0 comments on commit 6633103

Please sign in to comment.