Running 'testthat.R' [4s/5s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(uclust)
  Loading required package: dendextend
  
  ---------------------
  Welcome to dendextend version 1.13.2
  Type citation('dendextend') for how to cite the package.
  
  Type browseVignettes(package = 'dendextend') for the package vignette.
  The github page is: https://github.com/talgalili/dendextend/
  
  Suggestions and bug-reports can be submitted at: https://github.com/talgalili/dendextend/issues
  Or contact: <tal.galili@gmail.com>
  
  	To suppress this message use:  suppressPackageStartupMessages(library(dendextend))
  ---------------------
  
  
  Attaching package: 'dendextend'
  
  The following object is masked from 'package:stats':
  
      cutree
  
  Loading required package: robcor
  > 
  > test_check("uclust")
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  uclust
   --- call from context --- 
  bn(c(1, 0, 0, 0), md)
   --- call from argument --- 
  if (class(md) != "matrix") {
      stop("md is not of class matrix")
  }
   --- R stacktrace ---
  where 1: bn(c(1, 0, 0, 0), md)
  where 2: eval_bare(expr, quo_get_env(quo))
  where 3: quasi_label(enquo(object), label, arg = "object")
  where 4 at testthat/test.bn.R#6: expect_equal(bn(c(1, 0, 0, 0), md), Bn(c(1, 3), md))
  where 5: eval(code, test_env)
  where 6: eval(code, test_env)
  where 7: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 8: doTryCatch(return(expr), name, parentenv, handler)
  where 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 10: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 11: doTryCatch(return(expr), name, parentenv, handler)
  where 12: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 13: tryCatchList(expr, classes, parentenv, handlers)
  where 14: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 15: test_code(desc, code, env = parent.frame())
  where 16 at testthat/test.bn.R#5: test_that("Bn functions are symetric and match", {
      expect_equal(bn(c(1, 0, 0, 0), md), Bn(c(1, 3), md))
      expect_equal(bn(c(0, 0, 0, 1), md), bn(c(1, 1, 1, 0), md))
      expect_equal(bn(c(0, 0, 1, 1), md), Bn(c(2, 2), md))
      expect_equal(Bn(c(3, 1), md), Bn(c(1, 3), md[c(4, 3, 2, 1), 
          c(4, 3, 2, 1)]))
  })
  where 17: eval(code, test_env)
  where 18: eval(code, test_env)
  where 19: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 20: doTryCatch(return(expr), name, parentenv, handler)
  where 21: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 22: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 23: doTryCatch(return(expr), name, parentenv, handler)
  where 24: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 25: tryCatchList(expr, classes, parentenv, handlers)
  where 26: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 27: test_code(NULL, exprs, env)
  where 28: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 29: force(code)
  where 30: doWithOneRestart(return(expr), restart)
  where 31: withOneRestart(expr, restarts[[1L]])
  where 32: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 33: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 34: FUN(X[[i]], ...)
  where 35: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 36: force(code)
  where 37: doWithOneRestart(return(expr), restart)
  where 38: withOneRestart(expr, restarts[[1L]])
  where 39: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 40: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 41: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 43: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 44: test_check("uclust")
  
   --- value of length: 2 type: logical ---
  [1] FALSE  TRUE
   --- function from context --- 
  function (group_id, md = NULL, data = NULL) 
  {
      if (is.null(md)) {
          if (is.null(data)) {
              stop("No data provided")
          }
          md <- as.matrix(dist(data)^2)
      }
      if (class(md) != "matrix") {
          stop("md is not of class matrix")
      }
      group1 <- (group_id == 0)
      group2 <- group_id == 1
      ngv <- c(sum(group1), sum(group2))
      ng <- dim(md)[1]
      if (ng != sum(ngv)) {
          stop("Incorrect dimension or group_id")
      }
      if (min(ngv) > 1) {
          s11 <- sum(md[group1, group1])/2
          s22 <- sum(md[group2, group2])/2
          s12 <- sum(md[group1, group2])
          a1 <- (1/(ngv[1] * ngv[2])) * s12
          a2 <- (2/(ngv[1] * (ngv[1] - 1))) * s11
          a3 <- (2/(ngv[2] * (ngv[2] - 1))) * s22
          sBn <- (ngv[1] * ngv[2]/(ng * (ng - 1))) * (2 * a1 - 
              a2 - a3)
      }
      else {
          if (ngv[1] == 1) {
              s22 <- sum(md[group2, group2])/2
              s12 <- sum(md[group1, group2])
              a1 <- (1/(ngv[1] * ngv[2])) * s12
              a2 <- 0
              a3 <- (2/(ngv[2] * (ngv[2] - 1))) * s22
              sBn <- (ngv[1] * ngv[2]/(ng * (ng - 1))) * (a1 - 
                  a2 - a3)
          }
          else {
              s11 <- sum(md[group1, group1])/2
              s12 <- sum(md[group1, group2])
              a1 <- (1/(ngv[1] * ngv[2])) * s12
              a2 <- (2/(ngv[1] * (ngv[1] - 1))) * s11
              a3 <- 0
              sBn <- (ngv[1] * ngv[2]/(ng * (ng - 1))) * (a1 - 
                  a2 - a3)
          }
      }
      sBn
  }
  <bytecode: 0x2205aa0>
  <environment: namespace:uclust>
   --- function search by body ---
  Function bn in namespace uclust has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 1. Error: Bn functions are symetric and match (@test.bn.R#6)  ---------------
  the condition has length > 1
  Backtrace:
   1. testthat::expect_equal(bn(c(1, 0, 0, 0), md), Bn(c(1, 3), md))
   4. uclust::bn(c(1, 0, 0, 0), md)
  
  == testthat results  ===========================================================
  [ OK: 0 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 1 ]
  1. Error: Bn functions are symetric and match (@test.bn.R#6) 
  
  Error: testthat unit tests failed
  Execution halted