tests/testthat/test_netPath.R

library(skynet)

context("Create Path Network")



test_that("make_net_path works", {
  # Run simple net test
  test <- make_net_path(OD_Sample)
  expect_length(test, 14)
  expect_output(str(nrow(test)), "2182")
})

test_that("make_net_path with leg", {
  # Run simple net test
  test <- make_net_path(OD_Sample, leg = TRUE)
  expect_length(test$netLegCount$legCount, 2749)
  expect_length(test$netLegCount, 7)
})

test_that("make_net_path with zero tickets", {
  # Run simple net test
  test <- make_net_path(OD_Sample, zero = TRUE)
  expect_length(test$pct_zero, 2182)
})

test_that("make_net_path with carriers", {
  # Run simple net test
  test <- make_net_path(OD_Sample, carrier = TRUE)
  expect_length(test$op_carrier, 2749)
})

Try the skynet package in your browser

Any scripts or data that you put into this service are public.

skynet documentation built on June 17, 2022, 5:05 p.m.