Skip to content

Commit

Permalink
Add names to ji_find
Browse files Browse the repository at this point in the history
Fixes #4
  • Loading branch information
hadley committed Apr 28, 2017
1 parent 97754fd commit d0f71f6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DESCRIPTION
Expand Up @@ -11,8 +11,9 @@ Depends: R (>= 2.10)
License: GPL-3
Encoding: UTF-8
LazyData: true
Imports:
Imports:
tibble
RoxygenNote: 6.0.1
URL: https://github.com/hadley/emo
BugReports: https://github.com/hadley/emo/issues
Suggests: testthat
Binary file modified R/sysdata.rda
Binary file not shown.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -20,6 +20,8 @@ devtools::install_github("hadley/emo")
Example
-------

*💩*

You can either refer to emoji by their name (which is unique):

``` r
Expand Down
2 changes: 2 additions & 0 deletions data-raw/emojis.R
Expand Up @@ -25,6 +25,8 @@ invert <- function(x) {

emoji_keyword <- invert(keywords)

emoji_keyword[names(emoji_name)] <- map2(emoji_keyword[names(emoji_name)], names(emoji_name), union)

devtools::use_data(
emoji_name,
emoji_keyword,
Expand Down
4 changes: 4 additions & 0 deletions tests/testthat.R
@@ -0,0 +1,4 @@
library(testthat)
library(emo)

test_check("emo")
6 changes: 6 additions & 0 deletions tests/testthat/test-ji_find.R
@@ -0,0 +1,6 @@
context("ji_find")

test_that("can find names", {
out <- ji_find("beer")
expect_equal(out$emoji, as.character(ji("beer")))
})

0 comments on commit d0f71f6

Please sign in to comment.