inst/unitTests/test_deleteEdge.R

# Copyright 2012 Paolo Martini <paolo.cavei@gmail.com>

library(gRbase)

graph <- dag(c("me","ve"),c("me","al"),c("ve","al"),c("al","an"),c("al","st"),c("an","st"))
graph.out <- dag(c("me"), c("ve"), c("me","al"),c("ve","al"),c("al","an"),c("al","st"),c("an","st"))

checkSameGraph <- function(g1, g2) {
  identical(as(g1, "matrix"),as(g1, "matrix"))
}

test_deleteEdge <- function(){
  checkTrue(checkSameGraph(deleteEdge(graph, "ve", "me"), graph.out))
  checkException(deleteEdge(graph, "me", "ve"))
}

Try the clipper package in your browser

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

clipper documentation built on Nov. 8, 2020, 6:18 p.m.