Running 'degree_tests.R' [10s]
  Running 'density_tests.R' [4s]
  Running 'durations_tests.R' [3s]
  Running 'fromDissTests.R' [3s]
  Running 'pShift_tests.R' [150s]
  Running 'path_tests.R' [156s]
  Running 'reachable_tests.R' [104s]
  Running 'statsWrapper_tests.R' [98s]
  Running 'timeProjectedNetwork_tests.R' [111s]
Running the tests in 'tests/pShift_tests.R' failed.
Complete output:
  > library(tsna)
  Loading required package: network
  
  'network' 1.18.2 (2023-12-04), part of the Statnet Project
  * 'news(package="network")' for changes since last version
  * 'citation("network")' for citation information
  * 'https://statnet.org' for help, support, and other information
  
  Loading required package: networkDynamic
  
  'networkDynamic' 0.11.4 (2023-12-10?), part of the Statnet Project
  * 'news(package="networkDynamic")' for changes since last version
  * 'citation("networkDynamic")' for citation information
  * 'https://statnet.org' for help, support, and other information
  
  > library(testthat)
  > 
  > 
  > data(McFarland_cls33_10_16_96)
  > output<-pShiftCount(cls33_10_16_96)
  Loading required namespace: relevent
  > 
  > expect_equal(ncol(output),13)
  > 
  > # check expected values for clss 33
  > expect_equal(output, matrix(c(247,2,45,3,2,5,4,7,8,155,0,1,29),ncol=13, byrow=TRUE),check.attributes=FALSE)
  > 
  > # check alternate outputformat
  > output <-pShiftCount(cls33_10_16_96,output='full')
  > expect_equal(dim(output),c(691,18))
  > expect_equal(colnames(output),c("AB-BA","AB-B0","AB-BY","A0-X0","A0-XA","A0-XY","AB-X0","AB-XA","AB-XB","AB-XY","A0-AY","AB-A0","AB-AY"   , "onset","terminus", "tail","head","group"))
  > 
  > 
  > # test for non-directed network
  > expect_error(pShiftCount(as.networkDynamic(network.initialize(10,directed=FALSE))),regexp = 'only appropriate for directed networks')
  > 
  > # test for empty network
  > expect_equal(nrow(pShiftCount(as.networkDynamic(network.initialize(10)))),0)
  > # test for zero network
  > expect_equal(nrow(pShiftCount(as.networkDynamic(network.initialize(0)))),0)
  > 
  > # test for time range
  > expect_equal(pShiftCount(cls33_10_16_96,start=10,end=11), matrix(c(4,0,2,0,0,0,0,0,0,1,0,0,1),ncol=13, byrow=TRUE),check.attributes=FALSE)
  > 
  > 
  > 
  > #  construct network that tests each shift
  > test1<-networkDynamic(edge.spells=matrix(c(0,1,1,2,
  +                                            1,2,2,1),ncol=4,byrow = TRUE))
  Initializing base.net of size 2 imputed from maximum vertex id in edge records
  Created net.obs.period to describe network
   Network observation period info:
    Number of observation spells: 1 
    Maximal time range observed: 0 until 2 
    Temporal mode: continuous 
    Time unit: unknown 
    Suggested time increment: NA 
  > expect_equal(as.numeric(pShiftCount(test1)),c(1,0,0,0,0,0,0,0,0,0,0,0,0))
  > 
  > test2<-networkDynamic(edge.spells=matrix(c(0,1,1,2,
  +                                            1,2,2,1,
  +                                            1,2,2,3,
  +                                            1,2,2,4,
  +                                            1,2,2,5
  +                                           ),ncol=4,byrow = TRUE))
  Initializing base.net of size 5 imputed from maximum vertex id in edge records
  Created net.obs.period to describe network
   Network observation period info:
    Number of observation spells: 1 
    Maximal time range observed: 0 until 2 
    Temporal mode: continuous 
    Time unit: unknown 
    Suggested time increment: NA 
  > expect_equal(as.numeric(pShiftCount(test2)),c(0,1,0,0,0,0,0,0,0,0,0,0,0))
  > 
  > test3<-networkDynamic(edge.spells=matrix(c(0,1,1,2,
  +                                            1,2,2,3),ncol=4,byrow = TRUE))
  Initializing base.net of size 3 imputed from maximum vertex id in edge records
  Created net.obs.period to describe network
   Network observation period info:
    Number of observation spells: 1 
    Maximal time range observed: 0 until 2 
    Temporal mode: continuous 
    Time unit: unknown 
    Suggested time increment: NA 
  > expect_equal(as.numeric(pShiftCount(test3)),c(0,0,1,0,0,0,0,0,0,0,0,0,0))
  > 
  > test4<-networkDynamic(edge.spells=matrix(c(0,1,1,2,
  +                                            0,1,1,3,
  +                                            0,1,1,4,
  +                                            1,2,2,1,
  +                                            1,2,2,3,
  +                                            1,2,2,4
  + ),ncol=4,byrow = TRUE))
  Initializing base.net of size 4 imputed from maximum vertex id in edge records
  Created net.obs.period to describe network
   Network observation period info:
    Number of observation spells: 1 
    Maximal time range observed: 0 until 2 
    Temporal mode: continuous 
    Time unit: unknown 
    Suggested time increment: NA 
  > expect_equal(as.numeric(pShiftCount(test4)),c(0,0,0,1,0,0,0,0,0,0,0,0,0))
  > 
  > test5<-networkDynamic(edge.spells=matrix(c(0,1,1,2,
  +                                            0,1,1,3,
  +                                            0,1,1,4,
  +                                            1,2,2,1
  + ),ncol=4,byrow = TRUE))
  Initializing base.net of size 4 imputed from maximum vertex id in edge records
  Created net.obs.period to describe network
   Network observation period info:
    Number of observation spells: 1 
    Maximal time range observed: 0 until 2 
    Temporal mode: continuous 
    Time unit: unknown 
    Suggested time increment: NA 
  > expect_equal(as.numeric(pShiftCount(test5)),c(0,0,0,0,1,0,0,0,0,0,0,0,0))
  > 
  > test6<-networkDynamic(edge.spells=matrix(c(0,1,1,2,
  +                                            0,1,1,3,
  +                                            0,1,1,4,
  +                                            1,2,2,3
  + ),ncol=4,byrow = TRUE))
  Initializing base.net of size 4 imputed from maximum vertex id in edge records
  Created net.obs.period to describe network
   Network observation period info:
    Number of observation spells: 1 
    Maximal time range observed: 0 until 2 
    Temporal mode: continuous 
    Time unit: unknown 
    Suggested time increment: NA 
  > expect_equal(as.numeric(pShiftCount(test6)),c(0,0,0,0,0,1,0,0,0,0,0,0,0))
  > 
  > test7<-networkDynamic(edge.spells=matrix(c(0,1,1,2,
  +                                            1,2,3,1,
  +                                            1,2,3,2,
  +                                            1,2,3,4
  + ),ncol=4,byrow = TRUE))
  Initializing base.net of size 4 imputed from maximum vertex id in edge records
  Created net.obs.period to describe network
   Network observation period info:
    Number of observation spells: 1 
    Maximal time range observed: 0 until 2 
    Temporal mode: continuous 
    Time unit: unknown 
    Suggested time increment: NA 
  > expect_equal(as.numeric(pShiftCount(test7)),c(0,0,0,0,0,0,1,0,0,0,0,0,0))
  > 
  > test8<-networkDynamic(edge.spells=matrix(c(0,1,1,2,
  +                                            1,2,3,1
  + ),ncol=4,byrow = TRUE))
  Initializing base.net of size 3 imputed from maximum vertex id in edge records
  Created net.obs.period to describe network
   Network observation period info:
    Number of observation spells: 1 
    Maximal time range observed: 0 until 2 
    Temporal mode: continuous 
    Time unit: unknown 
    Suggested time increment: NA 
  > expect_equal(as.numeric(pShiftCount(test8)),c(0,0,0,0,0,0,0,1,0,0,0,0,0))
  > 
  > test9<-networkDynamic(edge.spells=matrix(c(0,1,1,2,
  +                                            1,2,3,2
  + ),ncol=4,byrow = TRUE))
  Initializing base.net of size 3 imputed from maximum vertex id in edge records
  Created net.obs.period to describe network
   Network observation period info:
    Number of observation spells: 1 
    Maximal time range observed: 0 until 2 
    Temporal mode: continuous 
    Time unit: unknown 
    Suggested time increment: NA 
  > expect_equal(as.numeric(pShiftCount(test9)),c(0,0,0,0,0,0,0,0,1,0,0,0,0))
  > 
  > test10<-networkDynamic(edge.spells=matrix(c(0,1,1,2,
  +                                            1,2,3,4
  + ),ncol=4,byrow = TRUE))
  Initializing base.net of size 4 imputed from maximum vertex id in edge records
  Created net.obs.period to describe network
   Network observation period info:
    Number of observation spells: 1 
    Maximal time range observed: 0 until 2 
    Temporal mode: continuous 
    Time unit: unknown 
    Suggested time increment: NA 
  > expect_equal(as.numeric(pShiftCount(test10)),c(0,0,0,0,0,0,0,0,0,1,0,0,0))
  > 
  > test11<-networkDynamic(edge.spells=matrix(c(0,1,1,2,
  +                                            0,1,1,3,
  +                                            0,1,1,4,
  +                                            1,2,1,2
  + ),ncol=4,byrow = TRUE))
  Initializing base.net of size 4 imputed from maximum vertex id in edge records
  Created net.obs.period to describe network
   Network observation period info:
    Number of observation spells: 1 
    Maximal time range observed: 0 until 2 
    Temporal mode: continuous 
    Time unit: unknown 
    Suggested time increment: NA 
  > expect_equal(as.numeric(pShiftCount(test11)),c(0,0,0,0,0,0,0,0,0,0,1,0,0))
  > 
  > 
  > test12<-networkDynamic(edge.spells=matrix(c(0,1,1,2,
  +                                            1,2,1,2,
  +                                            1,2,1,3,
  +                                            1,2,1,4
  + ),ncol=4,byrow = TRUE))
  Initializing base.net of size 4 imputed from maximum vertex id in edge records
  Created net.obs.period to describe network
   Network observation period info:
    Number of observation spells: 1 
    Maximal time range observed: 0 until 2 
    Temporal mode: continuous 
    Time unit: unknown 
    Suggested time increment: NA 
  > expect_equal(as.numeric(pShiftCount(test12)),c(0,0,0,0,0,0,0,0,0,0,0,1,0))
  > 
  > test13<-networkDynamic(edge.spells=matrix(c(0,1,1,2,
  +                                             1,2,1,3
  + ),ncol=4,byrow = TRUE))
  Initializing base.net of size 3 imputed from maximum vertex id in edge records
  Created net.obs.period to describe network
   Network observation period info:
    Number of observation spells: 1 
    Maximal time range observed: 0 until 2 
    Temporal mode: continuous 
    Time unit: unknown 
    Suggested time increment: NA 
  > expect_equal(as.numeric(pShiftCount(test13)),c(0,0,0,0,0,0,0,0,0,0,0,0,1))
  > 
  > 
  > 
  > 
  > 
  > 
  > 
  > 
  > proc.time()
     user  system elapsed 
     2.62    0.37    2.98 
Running the tests in 'tests/path_tests.R' failed.
Complete output:
  > # tests for the path distance functions
  > 
  > require(tsna)
  Loading required package: tsna
  Loading required package: network
  
  'network' 1.18.2 (2023-12-04), part of the Statnet Project
  * 'news(package="network")' for changes since last version
  * 'citation("network")' for citation information
  * 'https://statnet.org' for help, support, and other information
  
  Loading required package: networkDynamic
  
  'networkDynamic' 0.11.4 (2023-12-10?), part of the Statnet Project
  * 'news(package="networkDynamic")' for changes since last version
  * 'citation("networkDynamic")' for citation information
  * 'https://statnet.org' for help, support, and other information
  
  > require(testthat)
  Loading required package: testthat
  > require(networkDynamicData)
  Loading required package: networkDynamicData
  > linegraph<-network.initialize(10)
  > add.edges(linegraph,tail=1:9,head=2:10)
  > 
  > data(concurrencyComparisonNets)
  > 
  > 
  > 
  > # ----- tests for tPath ----
  > 
  > 
  > 
  > test_that('tPath basic tests',{
  +   line<-network.initialize(4)
  +   add.edges.active(line,tail=1:3,head=2:4,onset=0:2,terminus=1:3)
  +   # check return format
  +   expect_equal(names(tPath(line,v=1)),c('tdist','previous','gsteps','start','end','direction','type'))
  +   expect_is(tPath(line,v=1),class = 'tPath')
  +   
  +   # check args
  +   expect_error(tPath(line,v=1,type='foo'))
  +   expect_error(tPath(line,v=1,direction='foo'))
  +   
  +   # check unimplemented
  +   expect_error(tPath(line,v=1,type='latest.depart'),regexp='method is not yet implemented')
  +   
  +   # check basic line with default earliest arriving fwd
  +   expect_equal(tPath(line,v=1)$tdist,c(0, 0, 1, 2))
  +   expect_equal(tPath(line,v=2)$tdist,c(Inf,0,1,2))
  +   
  +   # test starting and ending flags
  +   expect_equal(tPath(line,v=1,start=0.5)$tdist, c(0,0,0.5,1.5))
  +   expect_equal(tPath(line,v=1,start=2)$tdist, c(0,Inf,Inf,Inf))
  +   expect_equal(tPath(line,v=1,end=2)$tdist, c(0,0,1,Inf))
  +   
  +   line<-network.initialize(4)
  +   add.edges.active(line,tail=1:3,head=2:4,onset=c(2,1,3),terminus=c(3,2,4))
  +   expect_equal(tPath(line,v=1)$tdist,c(0,1,Inf,Inf))
  +   
  +   # test active default
  +   test<-as.networkDynamic(network.initialize(4))
  +   add.edges(test,1:3,2:4)
  +   expect_equal(tPath(test,v=1,start=0)$tdist,c(0,0,0,0))
  +   expect_equal(tPath(test,v=1,active.default=FALSE,start=0)$tdist,c(0,Inf,Inf,Inf))
  +   
  +   test<-network.initialize(4)
  +   add.edges(test,1:3,3:4)
  +   activate.edges(test,e=1,at=2)
  +   
  +   # test start message
  +   test<-as.networkDynamic(network.initialize(4))
  +   expect_message(tPath(test,v=1),regexp="'start' time parameter for paths was not specified")
  +   
  +   # test wrong object
  +   expect_error(tPath(network.initialize(3)),regexp='first argument must be a networkDynamic object')
  +   
  +   # test no v specified
  +   expect_error(tPath(as.networkDynamic(network.initialize(2)),regexp='argument with valid vertex ids was not given'))
  +   
  +   # test on network size 0
  +   expect_equal(tPath(as.networkDynamic(network.initialize(0)),start=0,v=numeric(0))$tdist,numeric(0))
  + })
  Test passed 🎉
  > 
  > 
  > # ----- tests for forward earliest paths ----
  > 
  > test_that("path in large base network matches",{
  +   fwdDFS<-tPath(base,v=24)
  +   expect_equal(sum(fwdDFS$tdist<Inf),772) # should find 772 vertices, because that is what we found with BFS search
  +   
  +   # check if we can find the same set as the 'infected'
  +   infset<-which(get.vertex.attribute.active(base,'status',at=102)>0)
  +   pathset<-which(tPath(base,v=24,graph.step.time=1)$tdist<Inf)
  + })
  Test passed 🥳
  > 
  > data(moodyContactSim)
  > 
  > 
  > # tests with moody's example network
  > test_that("test of moody's example network",{
  +   
  +   paths<-tPath(moodyContactSim,v=10)
  +   
  +   expect_equal(paths$tdist,c(543, 454, 594,   0, 672, 661, 184, 679, 634,   0, 709, 581, 413, 625, 669, 535))
  +   expect_equal(paths$previous,c(16,13,13,10,13,16,10,13,1,0,8,1,4,4,2,2))
  +   expect_equal(paths$gsteps,c(5, 3, 3, 1, 3, 5, 1, 3, 6, 0, 4, 6, 2, 2, 4, 4))
  +   
  +   # render a pdf for visual inspection of correctness
  +   # tree<-create_tree(paths)
  +   # pdf(file="MoodyTestNetTree.pdf",width=10,height=5)
  +   # par(mfcol=c(1,2))
  +   # plot(moodyContactSim,displaylabels=TRUE,
  +   #      edge.label=lapply(get.edge.activity(moodyContactSim),
  +   #                         function(spl){
  +   #                           paste("(",spl[,1],"-",spl[,2],")",sep=
  +   #                                   ''
  +   #                           )
  +   #                         }),
  +   #      edge.label.col='blue',
  +   #      edge.label.cex=0.6,
  +   #      main="moody example net")
  +   # 
  +   # plot(tree,
  +   #      coord=layout.normalize(network.layout.animate.Graphviz(tree,layout.par=list(gv.engine='dot')),keep.aspect.ratio=FALSE),
  +   #      displaylabels=TRUE,
  +   #      jitter=FALSE,
  +   #      label.pos=2,
  +   #      main='earliest paths from v10',
  +   #      edge.label=lapply(get.edge.activity(tree),
  +   #                        function(spl){
  +   #                          paste("(",spl[,1],")",sep=
  +   #                                  ''
  +   #                          )
  +   #                        }),
  +   #      edge.label.col='blue',
  +   #      edge.label.cex=0.6)
  +   # par(mfcol=c(1,1))
  +   # dev.off()
  + })
  Test passed 🎊
  > 
  > 
  > 
  > test_that("test on network with two components",{
  +   test<-network.initialize(10)
  +   activate.vertices(test)
  +   test[1:5,5:1]<-1
  +   test[6:10,10:6]<-1
  +   expect_equal(which(tPath(test,v=1)$tdist!=Inf),1:5)
  +   expect_equal(which(tPath(test,v=6)$tdist!=Inf),6:10)
  + })
  Test passed 🌈
  > 
  > 
  > 
  > # test path distance
  > test_that("graph step time param works",{
  +   test<-network.initialize(4)
  +   add.edges.active(test,tail=1:3,head=2:4,onset=0:2,terminus=1:3)
  +   # count each geodesic step as instantaneous
  +   expect_equal(tPath(test,v=1,graph.step.time=0)$tdist,c(0, 0, 1, 2))
  +   # count each geodesic step as something less than 1
  +   expect_equal(tPath(test,v=1,graph.step.time=0.5)$tdist,c(0, 0.5, 1.5, 2.5))
  +   # count each geodesic step as 1
  +   expect_equal(tPath(test,v=1,graph.step.time=1)$tdist,c(0, 1, 2, 3))
  +   # count each geodesic step as 2
  +   expect_equal(tPath(test,v=1,graph.step.time=2)$tdist,c(0, Inf, Inf, Inf))
  +   
  +   # test with always active edges
  +   test<-network.initialize(4)
  +   add.edges.active(test,tail=1:3,head=2:4,onset=0,terminus=10)
  +   # count each geodesic step as 1
  +   expect_equal(tPath(test,v=1,graph.step.time=1)$tdist,c(0, 1, 2, 3))
  +   # count each geodesic step as 2
  +   expect_equal(tPath(test,v=1,graph.step.time=2)$tdist,c(0, 2, 4, 6))
  +   # count each geodesic step as 0
  +   expect_equal(tPath(test,v=1,graph.step.time=0)$tdist,c(0, 0, 0, 0))
  +   
  +   test<-as.networkDynamic(network.initialize(4))
  +   add.edges(test,tail=1:3,head=2:4)
  +   # count each geodesic step as 1
  +   expect_equal(tPath(test,v=1,graph.step.time=1)$tdist,c(0, 1, 2, 3))
  +   # count each geodesic step as 2
  +   expect_equal(tPath(test,v=1,graph.step.time=2)$tdist,c(0, 2, 4, 6))
  +   
  +   # test with an edge with multiple activity spells, some later
  +   test<-network.initialize(4)
  +   add.edges.active(test,tail=1:3,head=2:4,onset=0:2,terminus=1:3)
  +   activate.edges(test,e=1,onset=5,terminus=10)
  +   expect_equal(tPath(test,v=1,graph.step.time=2)$tdist,c(0, 7, Inf, Inf))
  +   
  +   # test with combination of start and end values
  +   test<-network.initialize(10)
  +   add.edges.active(test,tail=1:9,head=2:10,onset=0:9,terminus=10)
  +   tPath(test,v=1,start=5,graph.step.time=2)$tdist
  +   
  + })
  Test passed 🎊
  > 
  > # ----- tests for shortest geo fwd path ----
  > # construct a network in which distinguishes paths (
  > #
  > # tel<-matrix(c(2,3,1,2,
  > #               3,4,2,5,
  > #               4,5,5,3,
  > #               0,1,1,3,
  > #               5,6,1,4,
  > #               7,8,4,3),byrow=TRUE,ncol=4)
  > # # shortest path from 1 to 3 is the direct route, arriving at time
  > # test<-networkDynamic(edge.spells=tel)
  > # plot(test,displaylabels=TRUE,edge.label=paste(get.edge.attribute(test,'active',unlist=FALSE)),label.col='blue',edge.label.cex=0.7)
  > # 
  > # #path starting at time 0
  > # 
  > # path0<-tPath(test,v=1,type='fewest.steps')
  > # expect_equal(path0$tdist,c(0, 2, 0, 5, 3))
  > # expect_equal(path0$previous,c(0, 1, 1, 1, 2))
  > # expect_equal(path0$gsteps,c(0, 1, 1, 1, 2))
  > # 
  > # # path starting at v1 time 1
  > # # (direct path to v3 eliminated because it is too early)
  > # #   shortest geodesic path to v3 is  1-3
  > # #   earliest temporal path to v3 is 1-2-5-3
  > # #   shortest geodesic temporal path to v3 is 1-4-3
  > # path1<-tPath(test,v=1,start=1,type='fewest.steps')
  > # expect_equal(path1$tdist,c(0, 1, 6, 4, 2))
  > # expect_equal(path1$previous,c(0, 1, 4, 1, 2))
  > # expect_equal(path1$gsteps,c(0, 1, 2, 1, 2))
  > # 
  > # 
  > # # test for a later-leaving path arriving earlier
  > 
  > 
  > # ----- tests for paths.bkwd.latest -----
  > 
  > 
  > 
  > # reverse-ordered edge spells
  > test<-network.initialize(10)
  > add.edges(test,tail=1:9,head=2:10)
  > activate.edges(test,onset=10:0,terminus=11:1)
  > results<-tPath(test,v=5,direction='bkwd',type='latest.depart')
  > expect_equal(results$tdist,c(Inf, Inf, Inf,   3,   0, Inf, Inf, Inf, Inf, Inf))
  > expect_equal(results$previous,c(0, 0, 0, 5, 0, 0, 0, 0, 0, 0))
  > expect_equal(results$gsteps,c(Inf, Inf, Inf, 1, 0, Inf, Inf, Inf, Inf, Inf))
  > 
  > # forward-ordred edge spells
  > test<-network.initialize(10)
  > add.edges(test,tail=1:9,head=2:10)
  > activate.edges(test,onset=0:10,terminus=1:11)
  > results<-tPath(test,v=10,direction='bkwd',type='latest.depart')
  > expect_equal(results$tdist,c(8,7,6,5,4,3,2,1,0,0))
  > expect_equal(results$previous,c(2,3,4,5,6,7,8,9,10,0))
  > expect_equal(results$gsteps,c(9, 8, 7, 6, 5, 4, 3, 2, 1, 0))
  > 
  > # moody sim
  > results<-tPath(moodyContactSim,v=10,direction='bkwd',type='latest.depart')
  > expect_equal(results$tdist,c(Inf, Inf, Inf, 723, Inf, Inf, 539, Inf, Inf,   0, Inf, Inf, Inf, Inf, Inf, Inf))
  > expect_equal(results$previous,c(0,  0,  0, 10,  0,  0, 10,  0,  0,  0,  0,  0,  0,  0,  0,  0))
  > 
  > results<-tPath(moodyContactSim,v=16,direction='bkwd',type='latest.depart')
  > expect_equal(results$tdist,c(180, 196, Inf,  13, Inf,  62, Inf, Inf, Inf, 723, 548, Inf, 271, 103, Inf,   0))
  > expect_equal(results$previous,c(16, 16,  0, 16,  0, 16,  0,  0,  0,  4,  1,  0,  2,  4,  0,  0))
  > 
  > test_that("graph step time param works for bakward path",{
  +   test<-network.initialize(4)
  +   add.edges.active(test,tail=1:3,head=2:4,onset=0:2,terminus=1:3)
  +   # count each geodesic step as instantaneous
  +   expect_equal(tPath(test,v=4,graph.step.time=0,direction='bkwd',type='latest.depart')$tdist,c(2, 1, 0, 0))
  +   # count each geodesic step as something less than 1
  +   expect_equal(tPath(test,v=4,graph.step.time=0.5,direction='bkwd',type='latest.depart')$tdist,c(2.5, 1.5, 0.5, 0.0))
  +   # count each geodesic step as 1
  +   expect_equal(tPath(test,v=4,graph.step.time=1,direction='bkwd',type='latest.depart')$tdist,c(3, 2, 1, 0))
  +   # count each geodesic step as 2
  +   expect_equal(tPath(test,v=4,graph.step.time=2,direction='bkwd',type='latest.depart')$tdist,c( Inf, Inf, Inf,0))
  +   
  +   # test with always active edges
  +   test<-network.initialize(4)
  +   add.edges.active(test,tail=1:3,head=2:4,onset=0,terminus=10)
  +   # count each geodesic step as 1
  +   expect_equal(tPath(test,v=4,graph.step.time=1,direction='bkwd',type='latest.depart')$tdist,c(3, 2, 1, 0))
  +   # count each geodesic step as 2
  +   expect_equal(tPath(test,v=4,graph.step.time=2,direction='bkwd',type='latest.depart')$tdist,c(6, 4, 2, 0))
  +   # count each geodesic step as 0
  +   expect_equal(tPath(test,v=4,graph.step.time=0,direction='bkwd',type='latest.depart')$tdist,c(0, 0, 0, 0))
  +   
  +   test<-as.networkDynamic(network.initialize(4))
  +   add.edges(test,tail=1:3,head=2:4)
  +   # count each geodesic step as 1
  +   expect_equal(tPath(test,v=4,graph.step.time=1,direction='bkwd',type='latest.depart')$tdist,c(3, 2, 1, 0))
  +   # count each geodesic step as 2
  +   expect_equal(tPath(test,v=4,graph.step.time=2,direction='bkwd',type='latest.depart')$tdist,c(6, 4, 2, 0))
  +   
  +   # test with an edge with multiple activity spells, some later
  +   test<-network.initialize(4)
  +   add.edges.active(test,tail=1:3,head=2:4,onset=0:2,terminus=1:3)
  +   activate.edges(test,e=1,onset=5,terminus=10)
  +   expect_equal(tPath(test,v=4,graph.step.time=2,direction='bkwd',type='latest.depart')$tdist,c(Inf, Inf, 9, 0))
  +   
  + })
  ── Warning: graph step time param works for bakward path ───────────────────────
  'end' time parameter for paths was not specified, no network changes found, using 'end' value of 4
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...)
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─tsna::tPath(...)
   5.   └─tsna:::paths.bkwd.latest(...)
  
  ── Warning: graph step time param works for bakward path ───────────────────────
  'end' time parameter for paths was not specified, no network changes found, using 'end' value of 8
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...)
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─tsna::tPath(...)
   5.   └─tsna:::paths.bkwd.latest(...)
  
  > 
  > 
  > # --------- tests for tsna:::paths.fwd.latest ---------
  > # two paths, does it 
  > test<-network.initialize(2)
  > add.edges.active(test,tail=1,head=2,onset=0,terminus=1)
  > activate.edges(test,onset=2,terminus=3)
  > tPath(test,v=2,start=0,end=3)
  $tdist
  [1] Inf   0
  
  $previous
  [1] 0 0
  
  $gsteps
  [1] Inf   0
  
  $start
  [1] 0
  
  $end
  [1] 3
  
  $direction
  [1] "fwd"
  
  $type
  [1] "earliest.arrive"
  
  attr(,"class")
  [1] "tPath" "list" 
  > tsna:::paths.fwd.latest(test,v=2,start=0,end=3)
  $tdist
  [1] Inf   3
  
  $previous
  $previous[[1]]
  [1] 0
  
  $previous[[2]]
  [1] 2 0
  
  
  Warning message:
  In tsna:::paths.fwd.latest(test, v = 2, start = 0, end = 3) :
    paths.fwd.latest has not be fully tested and may not be correct
  > 
  > 
  > # create a network in which the latest-starting path and
  > # the latest ending path are not the same
  > test<-network.initialize(5,direct=FALSE)
  > add.edges(test,tail=c(1,1,2,4),head=c(3,2,4,3))
  > activate.edges(test,at=c(1,2,3,4))
  > plot(test,displaylabels=TRUE,edge.label=get.edge.activity(test))
  > # latest starting path v1 to v4 should be at time 2 (via edge 2)
  > # latest ending path v1 to v4 should be at time 4 (via edge 3)
  > tsna:::paths.fwd.latest(test,v=1,start=0,end=4)
  $tdist
  [1]   4   2   1   2 Inf
  
  $previous
  $previous[[1]]
  [1] 0 1 1 0 0
  
  $previous[[2]]
  [1] 2 0 1 2 0
  
  $previous[[3]]
  [1] 3 0 0 0 0
  
  $previous[[4]]
  [1] 2 4 1 0 0
  
  $previous[[5]]
  [1] 0
  
  
  Warning message:
  In tsna:::paths.fwd.latest(test, v = 1, start = 0, end = 4) :
    paths.fwd.latest has not be fully tested and may not be correct
  > 
  > 
  > # create a network in which the latest-starting path and
  > # the latest ending path are not the same
  > test<-network.initialize(5,direct=FALSE)
  > add.edges(test,tail=c(1,1,2,4),head=c(3,2,4,3))
  > activate.edges(test,at=c(1,2,3,4))
  > plot(test,displaylabels=TRUE,edge.label=get.edge.activity(test))
  > tPath(test,v=1,start=0)
  $tdist
  [1]   0   2   1   3 Inf
  
  $previous
  [1] 0 1 1 2 0
  
  $gsteps
  [1]   0   1   1   2 Inf
  
  $start
  [1] 0
  
  $end
  [1] Inf
  
  $direction
  [1] "fwd"
  
  $type
  [1] "earliest.arrive"
  
  attr(,"class")
  [1] "tPath" "list" 
  > tsna:::paths.fwd.latest(test,v=1,start=0)
  $tdist
  [1]   4   2   1   2 Inf
  
  $previous
  $previous[[1]]
  [1] 0 1 1 0 0
  
  $previous[[2]]
  [1] 2 0 1 2 0
  
  $previous[[3]]
  [1] 3 0 0 0 0
  
  $previous[[4]]
  [1] 2 4 1 0 0
  
  $previous[[5]]
  [1] 0
  
  
  Warning message:
  In tsna:::paths.fwd.latest(test, v = 1, start = 0) :
    paths.fwd.latest has not be fully tested and may not be correct
  > 
  > # create a network in which an early-leaving path arrives latest
  > # the latest path from v1 to v3 should arrive at t4 via v4
  > test<-network.initialize(4,directed=FALSE)
  > add.edges(test,tail=c(1,1,2,4),head=c(3,2,4,3))
  > activate.edges(test,at=c(2,1,3,4))
  > plot(test,displaylabels=TRUE,edge.label=get.edge.activity(test))
  > 
  > 
  > 
  > # test network illustrating problems with implementation of graph.step.time
  > test<-network.initialize(4)
  > add.edges.active(test,1:3,2:4,at=1)
  > tPath(test,v=1,start=0)$tdist  # all vertices rechable at t=1
  [1] 0 1 1 1
  > tPath(test,v=1,start=0,graph.step.time = 1)$tdist  # no vertices are reachable because no path is open long enough for transmission to occur
  [1]   0 Inf Inf Inf
  > 
  > 
  > 
  > # the network below illustrates the various possible paths
  > # tests ability to distinguish paths
  > # howver, it is not a great complex test case since there are no
  > # indirect paths 
  > paths5<-network.initialize(7)
  > network.vertex.names(paths5)<-LETTERS[1:7]
  > add.edges.active(paths5,tail=c(1,2),head=c(2,7),onset=c(1,4),terminus=c(2,5))
  > add.edges.active(paths5,tail=c(1,3),head=c(3,7),onset=c(0,6),terminus=c(2,7))
  > add.edges.active(paths5,tail=c(1,4),head=c(4,7),onset=c(4,5),terminus=c(5,6))
  > add.edges.active(paths5,tail=c(1,5),head=c(5,7),onset=c(6,9),terminus=c(7,10))
  > add.edges.active(paths5,tail=c(1,6),head=c(6,7),onset=c(4,10),terminus=c(5,11))
  > plot(paths5, mode='circle',displaylabels=TRUE,edge.label=get.edge.activity(paths5),edge.label.col='blue',edge.label.cex=0.6)
  > as.data.frame(paths5)
     onset terminus tail head onset.censored terminus.censored duration edge.id
  1      1        2    1    2          FALSE             FALSE        1       1
  2      4        5    2    7          FALSE             FALSE        1       2
  3      0        2    1    3          FALSE             FALSE        2       3
  4      6        7    3    7          FALSE             FALSE        1       4
  5      4        5    1    4          FALSE             FALSE        1       5
  6      5        6    4    7          FALSE             FALSE        1       6
  7      6        7    1    5          FALSE             FALSE        1       7
  8      9       10    5    7          FALSE             FALSE        1       8
  9      4        5    1    6          FALSE             FALSE        1       9
  10    10       11    6    7          FALSE             FALSE        1      10
  > # FORWARDS
  > # earliest leaving ACG @ 6
  > # earliest arriving ABG @ 4
  > res2<-tPath(paths5,v=1)
  > expect_equal(res2$tdist[7],4)
  > # latest leaving AEG @ 10
  > 
  > 
  > # quickest ADG @ 5
  > # latest ariving  AFG @ 11
  > 
  > #BACKWARDS
  > 
  > 
  > # ----- tests for paths.fwd.approx ---
  > # data(moodyContactSim)
  > # # hard to test because random algorithm
  > # 
  > # split<-network.initialize(2)
  > # add.edges.active(split,tail=1,head=2,onset=0,terminus=1)
  > # arrivePercent<-paths.fwd.approx(split,v=1,tries=1000)
  > # # would expect 1/2,1/2
  > # 
  > # split<-network.initialize(2,directed=FALSE)
  > # add.edges.active(split,tail=1,head=2,onset=0,terminus=1)
  > # arrivePercent<-paths.fwd.approx(split,v=1,tries=1000)
  > # # would expect 1/2,1/2
  > # 
  > # split<-network.initialize(3)
  > # add.edges.active(split,tail=c(1,1),head=2:3,onset=0,terminus=1)
  > # arrivePercent<-paths.fwd.approx(split,v=1,tries=1000)
  > # # would expect 1/3,1/3,1/3
  > # 
  > # split<-network.initialize(5)
  > # add.edges.active(split,tail=c(1,1),head=2:3,onset=c(0,0.5),terminus=c(1,1))
  > # add.edges.active(split,tail=3,head=4,onset=0.5,terminus=1)
  > # # 
  > # plot(split,displaylabels=TRUE,edge.label=get.edge.activity(split))
  > # # 1/4 paths should remain on v1
  > # # 1/2 paths remain v2
  > # # 1/8 paths remain v3
  > # # 1/8 paths remain v4
  > # # 0 paths reach v5
  > # paths.fwd.approx(split,v=1,tries=100)
  > 
  > # for these values, set a rng seed
  > #set.seed(123)
  > #fwdProbs<-paths.fwd.approx(moodyContactSim,v=1)
  > #expect_equal(fwdProbs,c(0.858750, 0.000000, 0.000000, 0.000625, 0.000000, 0.001250, 0.000000, 0.001875, 0.036250, 0.000000, 0.023125, 0.038750, 0.000000, 0.000000, 0.000000, 0.039375))
  > #fwdProbs<-paths.fwd.approx(moodyContactSim,v=10,tries=100)
  > #expect_equal(fwdProbs,c(0, 0, 0, 0.01, 0, 0, 0.01, 0, 0, 0.98))
  > 
  > 
  > proc.time()
     user  system elapsed 
     3.26    0.26    3.51 
Running the tests in 'tests/reachable_tests.R' failed.
Complete output:
  > # test the forward and backward componetnt functions
  > require(tsna)
  Loading required package: tsna
  Loading required package: network
  
  'network' 1.18.2 (2023-12-04), part of the Statnet Project
  * 'news(package="network")' for changes since last version
  * 'citation("network")' for citation information
  * 'https://statnet.org' for help, support, and other information
  
  Loading required package: networkDynamic
  
  'networkDynamic' 0.11.4 (2023-12-10?), part of the Statnet Project
  * 'news(package="networkDynamic")' for changes since last version
  * 'citation("networkDynamic")' for citation information
  * 'https://statnet.org' for help, support, and other information
  
  > require(testthat)
  Loading required package: testthat
  > require(networkDynamicData)
  Loading required package: networkDynamicData
  > linegraph<-network.initialize(10)
  > add.edges(linegraph,tail=1:9,head=2:10)
  > 
  > # ---- forward.reachable tests -----
  > # test non timed version error
  > test<-linegraph
  > expect_error(forward.reachable(test,v=1),'must be a networkDynamic')
  > 
  > activate.edges(test,onset=0,terminus=3)
  > 
  > expect_equal(forward.reachable(test,v=1,per.step.depth=Inf),1:10)
  > 
  > # reverse-ordered edge spells
  > test<-linegraph
  > activate.edges(test,onset=10:0,terminus=11:1)
  > expect_equal(forward.reachable(test,v=5,per.step.depth=Inf),5:6)
  > expect_equal(forward.reachable(test,v=10,per.step.depth=Inf),10)
  > 
  > # forward-ordred edge spells
  > test<-linegraph
  > activate.edges(test,onset=0:10,terminus=1:11)
  > expect_equal(forward.reachable(test,v=5,per.step.depth=Inf),5:10)
  > expect_equal(forward.reachable(test,v=10,per.step.depth=Inf),10)
  > 
  > 
  > 
  > # test with two seeds
  > expect_equal(forward.reachable(test,v=c(1,5)),c(1,5,2,3,4,6,7,8,9,10))
  > 
  > # test on undirected case
  > test<-linegraph
  > set.network.attribute(test,'directed',FALSE)
  > activate.edges(test,onset=0,terminus=3)
  > expect_equal(forward.reachable(test,v=5,per.step.depth=Inf),c(5,4,6,3,7,2,8,1,9,10))
  > 
  > # test on network with bounded time
  > test<-linegraph
  > activate.edges(test,onset=0:10,terminus=1:11)
  > expect_equal(forward.reachable(test,v=5,start=4,end=6),c(5,6,7))
  > expect_equal(forward.reachable(test,v=1,end=6,per.step.depth=1),c(1,2,3,4,5,6,7))
  > 
  > 
  > # test with finite depthtest<-linegraph
  > test<-linegraph
  > activate.edges(test,onset=0,terminus=10)
  > expect_equal(forward.reachable(test,v=1,per.step.depth=2,end=3),1:7)
  > expect_equal(forward.reachable(test,v=1,per.step.depth=1.5,end=3),1:5)
  > 
  > test_that("test on network with two components",{
  +   test<-network.initialize(10)
  +   activate.vertices(test)
  +   test[1:5,5:1]<-1
  +   test[6:10,10:6]<-1
  +   expect_equal(forward.reachable(test,v=1),1:5)
  +   expect_equal(forward.reachable(test,v=6),6:10)
  + })
  Test passed 🎉
  > 
  > 
  > test_that("network with at spell durations",{
  +   test<-linegraph
  +   activate.edges(test,onset=0:10,terminus=0:10)
  +   expect_equal(forward.reachable(test,v=5,per.step.depth=Inf),5:10)
  +   expect_equal(forward.reachable(test,v=10,per.step.depth=Inf),10)
  +   
  + })
  Test passed 🎉
  > 
  > 
  > 
  > # test on network with net.obs.period set
  > 
  > # test on network with way too many time steps
  > data(hospital_contact)
  > #forward.reachable(hospital,v=1,start=120, end=347640,interval=300,per.step.depth=1)
  > 
  > 
  > # test that it matches infction in example network
  > 
  > data(concurrencyComparisonNets)
  > which(get.vertex.attribute.active(base,'status',at=1)==1)
  [1] 24
  > # size of forward component in base from v 24
  > sum(get.vertex.attribute.active(base,'status',at=102)==1)
  [1] 432
  > 
  > epiFound<-which(get.vertex.attribute.active(base,'status',at=102)==1)
  > fwdFound<-forward.reachable(base,v=24,per.step.depth=1,end=100)
  > expect_equal(length(setdiff(fwdFound,epiFound)),0)
  > 
  > # --- profiling -----#
  > # fiveRuns1<-function(){
  > #   forward.reachable1(base,v=1,per.step.depth=1)
  > #   forward.reachable1(base,v=2,per.step.depth=1)
  > #   forward.reachable1(base,v=3,per.step.depth=1)
  > #   forward.reachable1(base,v=4,per.step.depth=1)
  > #   forward.reachable1(base,v=5,per.step.depth=1)
  > # }
  > # fiveRuns2<-function(){
  > #   forward.reachable2(base,v=1,per.step.depth=1)
  > #   forward.reachable2(base,v=2,per.step.depth=1)
  > #   forward.reachable2(base,v=3,per.step.depth=1)
  > #   forward.reachable2(base,v=4,per.step.depth=1)
  > #   forward.reachable2(base,v=5,per.step.depth=1)
  > # }
  > # 
  > # # memory profiling
  > # Rprof(filename='fwdReachable.before')
  > # fiveRuns2()
  > # Rprof(NULL)
  > # summaryRprof(filename='fwdReachable.before')
  > 
  > # # time profiling
  > # library(microbenchmark)
  > # timing<-microbenchmark(fiveRuns1(),fiveRuns2(),times=1)
  > 
  > # ------ tests for the reachable set sizes ----
  > 
  > data(moodyContactSim)
  > expect_equal(sort(tReach(moodyContactSim)),c(2,  2,  3,  3,  3,  3,  5,  5,  6,  8, 10, 10, 14, 15, 16, 16))
  > 
  > expect_equal(sort(tReach(moodyContactSim,direction='bkwd')),c(3, 4, 5, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9))
  > 
  > 
  > 
  > 
  > proc.time()
     user  system elapsed 
     4.68    0.37    5.04 
Running the tests in 'tests/statsWrapper_tests.R' failed.
Complete output:
  > # tests for summary stats functions
  > library(tsna)
  Loading required package: network
  
  'network' 1.18.2 (2023-12-04), part of the Statnet Project
  * 'news(package="network")' for changes since last version
  * 'citation("network")' for citation information
  * 'https://statnet.org' for help, support, and other information
  
  Loading required package: networkDynamic
  
  'networkDynamic' 0.11.4 (2023-12-10?), part of the Statnet Project
  * 'news(package="networkDynamic")' for changes since last version
  * 'citation("networkDynamic")' for citation information
  * 'https://statnet.org' for help, support, and other information
  
  > require(sna)
  Loading required package: sna
  Loading required package: statnet.common
  
  Attaching package: 'statnet.common'
  
  The following objects are masked from 'package:base':
  
      attr, order
  
  sna: Tools for Social Network Analysis
  Version 2.7-2 created on 2023-12-05.
  copyright (c) 2005, Carter T. Butts, University of California-Irvine
   For citation information, type citation("sna").
   Type help(package="sna") to get started.
  
  > require(testthat)
  Loading required package: testthat
  > 
  > # ---- tests for tSnaStats ----
  > 
  > data(nd_test_nets)
  > data(moodyContactSim)
  > 
  > test_that('tSnaStats output as expected',{
  + 
  +   # vertex level measure
  +   output<-tSnaStats(moodyContactSim,'degree')
  +   
  +   expect_true(is.ts(output))
  +   expect_equal(ncol(output),network.size(moodyContactSim))
  +   expect_equal(nrow(output),756)
  +   
  +   # graph level measure
  +   output<-tSnaStats(moodyContactSim,'gden')
  +   expect_equal(ncol(output),1)
  +   expect_equal(nrow(output),756)
  +   
  +   # change sampling interval
  +   output<-tSnaStats(moodyContactSim,'gden',time.interval=100)
  +   expect_equal(ncol(output),1)
  +   expect_equal(nrow(output),8)
  +   
  +   # check start and end values
  +   expect_equal(attributes(tSnaStats(moodyContactSim,'gden',start=600,time.interval=50))$tsp,c(600.00, 750.00,   0.02))
  +   expect_equal(attributes(tSnaStats(moodyContactSim,'gden',end=600,time.interval=200))$tsp,c(40.000, 440.000,   0.005))
  +   
  +   expect_error(tSnaStats(nd_test_nets[[1]],'degree'),regexp = "must be a object of class 'networkDynamic'")
  +   
  +   # error for non supported function
  +   expect_error(tSnaStats(moodyContactSim,'foo'),regexp = 'not one of the sna package descriptive statistics currently supported')
  +   
  +   # test passing in function args (this would give error if FUN not passed in)
  +   tSnaStats(moodyContactSim,'centralization',FUN='degree',time.interval = 100)
  +   
  +   # test aggregate dur
  +   dyads<-network.dyadcount(moodyContactSim)
  +   expect_equal(as.numeric(tSnaStats(moodyContactSim,'gden',start=0,end=400,time.interval = 100,aggregate.dur=100)),c(1/dyads,0,2/dyads,0,2/dyads))
  +   # this one should miss all the edges
  +   expect_equal(as.numeric(tSnaStats(moodyContactSim,'gden',start=0,end=400,time.interval = 100,aggregate.dur=0)), c(0,0,0,0,0))
  +   
  + })
  Test passed 😸
  > 
  > 
  > 
  > supported_sna_funs <-c('components',
  +                        'triad.census',
  +                        'connectedness',
  +                        'dyad.census',
  +                        'efficiency',
  +                        'gden',
  +                        'hierarchy',
  +                        'lubness',
  +                        'mutuality',
  +                        # 'centralization', leaving off centralization because it requirs additional args
  +                        'closeness',
  +                        'betweenness',
  +                        #'bonpow',   hidden because has singular value problems
  +                        'degree',
  +                        'evcent',
  +                        'flowbet',
  +                        'graphcent',
  +                        'infocent',
  +                        'loadcent',
  +                        'prestige')
  > 
  > 
  > # chec
  > 
  > # test_that('all sna stats used by tSnaStats can be called',{
  > #   # CRAN reports that one of the functions is erroring with OpenBLAS
  > #   # I haven't been able to reproduce to isolate the function, so disabling these tests on cran
  > #   # SKIP_ON_CRAN NOT WORKING, NEED TO UNCOMMENT AND RUN MANUALLY
  > #   skip_on_cran() 
  > #   for (funName in supported_sna_funs){
  > #     message('testing ',funName)
  > #     tSnaStats(moodyContactSim,funName,start=600,time.interval=50)
  > #   }
  > #   
  > # })
  > 
  > 
  > # code below used to find which edge cases cause errors
  > # run tests against all the networkDynamic edge case networks
  > # reports, but does not trigger errors and warnings (because some of them will give errors)
  > # for(n in 1:length(nd_test_nets)){
  > #   for (funName in supported_sna_funs){
  > #       cat('testing net',n,' (',names(nd_test_nets)[n],') with term ',funName, '\n')
  > #       # run in tryCacth block so can report all the errors at once
  > #       tryCatch(
  > #     {
  > #       tSnaStats(nd_test_nets[[n]],funName)
  > #     },
  > #     warning = function(w){
  > #       message("\t",w)
  > #     },
  > #     error = function(e){
  > #       message("\t",e)
  > #     }
  > #       ) # end try catch
  > #      cat("\n")
  > #     }
  > # }
  > 
  > 
  > # ---- tests for tErgmStats ----
  > require(ergm)
  Loading required package: ergm
  
  'ergm' 4.6.0 (2023-12-17), part of the Statnet Project
  * 'news(package="ergm")' for changes since last version
  * 'citation("ergm")' for citation information
  * 'https://statnet.org' for help, support, and other information
  
  'ergm' 4 is a major update that introduces some backwards-incompatible
  changes. Please type 'news(package="ergm")' for a list of major
  changes.
  
  
  Attaching package: 'ergm'
  
  The following object is masked from 'package:statnet.common':
  
      snctrl
  
  > 
  > test_that('tSnaStats output as expected',{
  +   
  +   output<-tErgmStats(moodyContactSim,'~edges')
  +   
  +   expect_true(is.ts(output))
  +   expect_equal(ncol(output),1)
  +   expect_equal(nrow(output),756)
  +   
  +  
  +   output<-tErgmStats(moodyContactSim,'~degree(0:3)')
  +   expect_equal(ncol(output),4)
  +   expect_equal(nrow(output),756)
  +   
  +   # change sampling interval
  +   output<-tErgmStats(moodyContactSim,'~edges',time.interval=100)
  +   expect_equal(ncol(output),1)
  +   expect_equal(nrow(output),8)
  +   
  +   # check start and end values
  +   expect_equal(attributes(tErgmStats(moodyContactSim,'~edges',start=600,time.interval=50))$tsp,c(600.00, 750.00,   0.02))
  +   expect_equal(attributes(tErgmStats(moodyContactSim,'~edges',end=600,time.interval=200))$tsp,c(40.000, 440.000,   0.005))
  +   
  +   expect_error(tErgmStats(nd_test_nets[[1]],'edges'),regexp = "must be a object of class 'networkDynamic'")
  +   
  +   expect_error(tErgmStats(as.networkDynamic(network.initialize(3,hyper=TRUE)),'edges'),regexp = "not appropriate for hypergraphic networks")
  +   
  +   expect_error(tErgmStats(as.networkDynamic(network.initialize(3,multi=TRUE)),'edges'),regexp = "not appropriate for multiplex networks")
  +   
  +   # check that it will add '~' in front if ommited
  +   tErgmStats(moodyContactSim,'edges',time.interval=200)
  +   
  +   # error for non supported function
  +   expect_error(tErgmStats(moodyContactSim,'foo'),regexp = 'ERGM term .+ not found.')
  +   
  +   # test aggregate dur
  +   expect_equal(as.numeric(tErgmStats(moodyContactSim,'edges',time.interval = 100)),c(1,0,2,0,0,0,2,1))
  +   expect_equal(as.numeric(tErgmStats(moodyContactSim,'edges',time.interval = 100,aggregate.dur=100)),c(1,2,2,0,2,4,8,4))
  +   
  + })
  Test passed 🥳
  > 
  > # code below used to find which edge cases cause errors
  > # run tests against all the networkDynamic edge case networks
  > # reports, but does not trigger errors and warnings (because some of them will give errors)
  > # does not use a comprehensive set of ergm terms
  > 
  > # testErgmTerms<-c('edges','nsp(1)','balance')
  > # 
  > # for(n in 1:length(nd_test_nets)){
  > #   for (funName in testErgmTerms){
  > #       cat('testing net',n,' (',names(nd_test_nets)[n],') with term ',funName, '\n')
  > #       # run in tryCacth block so can report all the errors at once
  > #       tryCatch(
  > #     {
  > #       tErgmStats(nd_test_nets[[n]],funName)
  > #     },
  > #     warning = function(w){
  > #       message("\t",w)
  > #     },
  > #     error = function(e){
  > #       message("\t",e)
  > #     }
  > #       ) # end try catch
  > #      cat("\n")
  > #     }
  > # }
  > 
  > 
  > 
  > proc.time()
     user  system elapsed 
    18.67    0.78   19.43 
Running the tests in 'tests/timeProjectedNetwork_tests.R' failed.
Complete output:
  > # tests for the time-projected functions
  > 
  > require(tsna)
  Loading required package: tsna
  Loading required package: network
  
  'network' 1.18.2 (2023-12-04), part of the Statnet Project
  * 'news(package="network")' for changes since last version
  * 'citation("network")' for citation information
  * 'https://statnet.org' for help, support, and other information
  
  Loading required package: networkDynamic
  
  'networkDynamic' 0.11.4 (2023-12-10?), part of the Statnet Project
  * 'news(package="networkDynamic")' for changes since last version
  * 'citation("networkDynamic")' for citation information
  * 'https://statnet.org' for help, support, and other information
  
  > library(networkDynamicData)
  > require(testthat)
  Loading required package: testthat
  > 
  > # trivial example network, directed case
  > test<-network.initialize(3)
  > add.edges.active(test,tail=1,head=2,onset=0,terminus=1)
  > add.edges.active(test,tail=2,head=3,onset=1,terminus=2)
  > testProj<-timeProjectedNetwork(test,start=0,end=2)
  > expect_equal(as.matrix(testProj),
  +               matrix(
  +               c(0, 1, 0, 1, 0, 0,
  +                 0, 0, 0, 0, 1, 0,
  +                 0, 0, 0, 0, 0, 1,
  +                 0, 0, 0, 0, 0, 0,
  +                 0, 0, 0, 0, 0, 1,
  +                 0, 0, 0, 0, 0, 0),ncol=6,byrow=TRUE),check.attributes=FALSE)
  > 
  > # undirected case
  > test%n%'directed'<-FALSE
  > testProj<-timeProjectedNetwork(test,start=0,end=2)
  > expect_equal(as.matrix(testProj),
  +              matrix(
  +                c(0, 1, 0, 1, 0, 0,
  +                  1, 0, 0, 0, 1, 0,
  +                  0, 0, 0, 0, 0, 1,
  +                  0, 0, 0, 0, 0, 0,
  +                  0, 0, 0, 0, 0, 1,
  +                  0, 0, 0, 0, 1, 0),ncol=6,byrow=TRUE),check.attributes=FALSE)
  > 
  > 
  > # test edge attribute
  > data("nd_test_nets")
  > test<-nd_test_nets[[27]]
  > activate.edge.attribute(test,'foo',onset=1,terminus=2,'A')
  > activate.edge.attribute(test,'foo',onset=2,terminus=3,'B')
  > activate.edge.attribute(test,'foo',onset=3,terminus=4,'C')
  > activate.edge.attribute(test,'foo',onset=4,terminus=5,'D')
  > activate.edge.attribute(test,'foo',onset=5,terminus=6,'E')
  > activate.edge.attribute(test,'foo',onset=6,terminus=7,'F')
  > activate.edge.attribute(test,'foo',onset=7,terminus=8,'G')
  > testProj<-timeProjectedNetwork(test,start=0,end=10)
  > expect_equal(get.edge.attribute(testProj,'foo'),c("A", "B", "C", "D", "E", "F", "G", NA , NA))
  > expect_equal(get.edge.attribute(testProj,'pid'),1:9)
  > # in the undirected case, edges should be copied twice
  > test%n%'directed'<-FALSE
  > testProj<-timeProjectedNetwork(test,start=0,end=10)
  > expect_equal(get.edge.attribute(testProj,'foo'),c("A", "A","B","B", "C","C","D", "D", "E","E","F", "F", "G","G",NA,NA, NA , NA))
  > expect_equal(get.edge.attribute(testProj,'pid'),c(1 ,1 ,2 ,2 ,3 ,3 ,4 ,4 ,5, 5, 6, 6 ,7, 7, 8, 8 ,9 ,9))
  > 
  > data(moodyContactSim)
  > changes<-get.change.times(moodyContactSim)
  > moodyProj<-timeProjectedNetwork(moodyContactSim,onsets=changes,termini=changes)
  > # make sure the listing didn't get mangled for NA
  > expect_equal(length(moodyProj%e%'na'),length(get.edge.attribute(moodyProj,'na',unlist=FALSE)))
  > 
  > data(harry_potter_support)
  > hpProj<-timeProjectedNetwork(harry_potter_support)
  > plot(hpProj,arrowhead.cex = 0,edge.col=ifelse(hpProj%e%'edge.type'=='within_slice','black','gray'),vertex.cex=0.7)
  > 
  > # check that specific slices copied correctly
  > # WHY DOES THIS FAIL?
  > #expect_equal(as.matrix(network.extract(harry_potter_support,at=5)),as.matrix(hpProj)[(64*4+1):(64*5),(64*4+1):(64*5)])
  > 
  > # check that vertex attributes copied
  > expect_equal((hpProj%v%'gender')[1:64],harry_potter_support%v%'gender')
  > expect_equal((hpProj%v%'gender')[65:128],harry_potter_support%v%'gender')
  > 
  > expect_equal(length(network.vertex.names(hpProj)),network.size(hpProj))
  > 
  > # check edge type added
  > expect_true("edge.type"%in%list.edge.attributes(hpProj))
  > 
  > 
  > moodyProj<-timeProjectedNetwork(moodyContactSim,time.increment=100)
  > 
  > # correct size of new network?
  > expect_equal(network.size(moodyContactSim)*(moodyContactSim%n%'net.obs.period')$observations[[1]][2]/100,network.size(moodyProj))
  > 
  > # create network from changes
  > changes<-get.change.times(moodyContactSim)
  > moodyProjChange<-timeProjectedNetwork(moodyContactSim,onsets=changes,termini =changes)
  > 
  > # test for some vertex inactivity
  > data(windsurfers)
  > windProj<-timeProjectedNetwork(windsurfers,start=0,end=5)
  > 
  > # gplot3d(windProj,edge.col=ifelse(proj%e%'edge.type'=='within_slice','black','gray'))
  > 
  > proc.time()
     user  system elapsed 
     2.56    0.20    2.75