File: test-notable.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 (38 lines) | stat: -rw-r--r-- 936 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
26
27
28
29
30
31
32
33
34
35
36
37
38

context("Notable graphs")

test_that("notable graphs work with make_graph", {

  g <- make_graph("Levi")
  g2 <- graph.famous("Levi")
  expect_true(identical_graphs(g, g2))

})

test_that("make_graph for notable graphs is case insensitive", {

  g <- make_graph("Levi")
  g2 <- make_graph("levi")
  expect_true(identical_graphs(g, g2))

})

test_that("spaces are replaced in make_graph for notable graphs", {

  g <- make_graph("Krackhardt_Kite")
  g2 <- make_graph("Krackhardt kite")
  expect_true(identical_graphs(g, g2))

})

test_that("warnings are given for extra arguments in make_graph for notables", {

  g0 <- make_graph("Levi")
  expect_warning(g1 <- make_graph("Levi", n = 10))
  expect_warning(g2 <- make_graph("Levi", isolates = "foo"))
  expect_warning(g3 <- make_graph("Levi", directed = FALSE))
  expect_true(identical_graphs(g0, g1))
  expect_true(identical_graphs(g0, g2))
  expect_true(identical_graphs(g0, g3))

})