From 3bf0f9e831b945b2ff2e71fcbcfce8b238f5478d Mon Sep 17 00:00:00 2001 From: Romain Franconville Date: Thu, 13 Feb 2020 13:57:46 -0500 Subject: [PATCH] Adding tests for neuprint_search with fixed to TRUE --- R/name.R | 3 ++- tests/testthat/test-name.R | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/R/name.R b/R/name.R index b8e07915..c480d9bd 100644 --- a/R/name.R +++ b/R/name.R @@ -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 diff --git a/tests/testthat/test-name.R b/tests/testthat/test-name.R index 57e6ed5f..ae00a14b 100644 --- a/tests/testthat/test-name.R +++ b/tests/testthat/test-name.R @@ -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')