File: test-versions.R

package info (click to toggle)
r-cran-igraph 1.0.1-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 18,232 kB
  • sloc: ansic: 173,538; cpp: 19,365; fortran: 4,550; yacc: 1,164; tcl: 931; lex: 484; makefile: 149; sh: 9
file content (25 lines) | stat: -rw-r--r-- 442 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

context("Data version and conversion")

test_that("we create graphs of the current version", {

  g <- make_ring(10)
  v1 <- graph_version(g)
  v2 <- graph_version()
  expect_equal(v1, v2)

})

test_that("we can upgrade from 0.4.0 to 0.8.0", {

  g <- make_ring(10)
  g <- unclass(g)
  g[[10]] <- NULL
  class(g) <- "igraph"

  expect_equal(graph_version(g), "0.4.0")

  g2 <- upgrade_graph(g)
  expect_equal(graph_version(g2), "0.8.0")

})