Skip to content

Commit

Permalink
test: merged and refactored make.R tests (#1685)
Browse files Browse the repository at this point in the history
  • Loading branch information
schochastics authored Feb 19, 2025
1 parent f5016e4 commit 70163da
Show file tree
Hide file tree
Showing 10 changed files with 454 additions and 319 deletions.
193 changes: 96 additions & 97 deletions R/make.R

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions tests/testthat/_snaps/make.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,46 @@
# error messages are proper

Code
make_()
Condition
Error in `.extract_constructor_and_modifiers()`:
! Don't know how to make_, nothing given
Code
make_(1:10)
Condition
Error in `.extract_constructor_and_modifiers()`:
! Don't know how to make_, nothing given
Code
graph_()
Condition
Error in `.extract_constructor_and_modifiers()`:
! Don't know how to graph_, nothing given
Code
graph_(1:10)
Condition
Error in `.extract_constructor_and_modifiers()`:
! Don't know how to graph_, nothing given
Code
graph_(directed_graph(), directed_graph())
Condition
Error in `.extract_constructor_and_modifiers()`:
! Don't know how to graph_, multiple constructors given
Code
sample_()
Condition
Error in `.extract_constructor_and_modifiers()`:
! Don't know how to sample_, nothing given
Code
sample_(1:10)
Condition
Error in `.extract_constructor_and_modifiers()`:
! Don't know how to sample_, nothing given
Code
sample_(directed_graph(), directed_graph())
Condition
Error in `.extract_constructor_and_modifiers()`:
! Don't know how to sample_, multiple constructors given

# graph_from_literal() and simple undirected graphs

Code
Expand Down Expand Up @@ -106,3 +149,11 @@
+ edges (vertex names):
[1] 1--1 1--2 1--2

# make_empty_graph gives an error for invalid arguments

Code
make_empty_graph(NULL)
Condition
Error in `make_empty_graph()`:
! At rinterface_extra.c:78 : Expecting a scalar integer but received a vector of length 0. Invalid value

11 changes: 0 additions & 11 deletions tests/testthat/test-graph.atlas.R

This file was deleted.

29 changes: 0 additions & 29 deletions tests/testthat/test-graph.bipartite.R

This file was deleted.

11 changes: 0 additions & 11 deletions tests/testthat/test-graph.de.bruijn.R

This file was deleted.

10 changes: 0 additions & 10 deletions tests/testthat/test-graph.kautz.R

This file was deleted.

Loading

0 comments on commit 70163da

Please sign in to comment.