Skip to content

Commit

Permalink
Adding tests for neuprint_search with fixed to TRUE
Browse files Browse the repository at this point in the history
  • Loading branch information
romainFr committed Feb 13, 2020
1 parent 03d35dc commit 3bf0f9e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/name.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ neuprint_get_roiInfo <- function(bodyids, dataset = NULL, all_segments = FALSE,
#' Other common options include type, status, cellBodyFiber etc.
#' @param fixed if FALSE (the default), \code{search} is interpreted as a regular expression
#' ("Advanced input" in neuprint explorer). If TRUE, the string \code{search} is interpreted as
#' a simple character string (the default search behavior in neuprint explorer).
#' a simple character string (the default search behavior in neuprint explorer) to be matched
#' (partial matches are fine)
#' @param meta if TRUE, meta data for found bodyids is also pulled
#' @return a vector of body ids, or a data frame with their meta information
#' @export
Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test-name.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ skip_if(as.logical(Sys.getenv("SKIP_NP_SERVER_TESTS")))

test_that("test name searches ", {
da2s = neuprint_search(".*DA2.*")
penAs = neuprint_search("PEN_a.*",field="type")
penAbis = neuprint_search("PEN_a(",field="type",fixed=TRUE)
expect_is(penAbis,'data.frame')
expect_equal(penAs,penAbis)
expect_match(neuprint_get_neuron_names(da2s$bodyid[1]), 'DA2')
expect_is(neuprint_search("DA2.*",field = "type"), 'data.frame')

Expand Down

0 comments on commit 3bf0f9e

Please sign in to comment.