Skip to content

Commit 3cbf32c

Browse files
committed
Format
1 parent 33de49e commit 3cbf32c

File tree

1 file changed

+38
-82
lines changed

1 file changed

+38
-82
lines changed

tests/testthat/test-aaa-auto.R

Lines changed: 38 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -750,9 +750,7 @@ test_that("preference_game_impl basic", {
750750
types = 2,
751751
type.dist = c(0.5, 0.5),
752752
fixed.sizes = FALSE,
753-
pref.matrix = matrix(c(0.5,
754-
0.5, 0.5, 0.5),
755-
2, 2)
753+
pref.matrix = matrix(c(0.5, 0.5, 0.5, 0.5), 2, 2)
756754
))
757755
})
758756
test_that("preference_game_impl errors", {
@@ -764,9 +762,7 @@ test_that("preference_game_impl errors", {
764762
types = 2,
765763
type.dist = c(0.5, 0.5),
766764
fixed.sizes = FALSE,
767-
pref.matrix = matrix(c(0.5,
768-
0.5, 0.5, 0.5),
769-
2, 2)
765+
pref.matrix = matrix(c(0.5, 0.5, 0.5, 0.5), 2, 2)
770766
)
771767
)
772768
})
@@ -779,12 +775,8 @@ test_that("asymmetric_preference_game_impl basic", {
779775
nodes = 5,
780776
out.types = 2,
781777
in.types = 2,
782-
type.dist.matrix = matrix(c(0.5,
783-
0.5, 0.5, 0.5),
784-
2, 2),
785-
pref.matrix = matrix(c(0.5,
786-
0.5, 0.5, 0.5),
787-
2, 2)
778+
type.dist.matrix = matrix(c(0.5, 0.5, 0.5, 0.5), 2, 2),
779+
pref.matrix = matrix(c(0.5, 0.5, 0.5, 0.5), 2, 2)
788780
))
789781
})
790782
test_that("asymmetric_preference_game_impl errors", {
@@ -795,12 +787,8 @@ test_that("asymmetric_preference_game_impl errors", {
795787
nodes = -1,
796788
out.types = 2,
797789
in.types = 2,
798-
type.dist.matrix = matrix(c(0.5,
799-
0.5, 0.5, 0.5),
800-
2, 2),
801-
pref.matrix = matrix(c(0.5,
802-
0.5, 0.5, 0.5),
803-
2, 2)
790+
type.dist.matrix = matrix(c(0.5, 0.5, 0.5, 0.5), 2, 2),
791+
pref.matrix = matrix(c(0.5, 0.5, 0.5, 0.5), 2, 2)
804792
)
805793
)
806794
})
@@ -1008,14 +996,12 @@ test_that("sbm_game_impl basic", {
1008996
local_igraph_options(print.id = FALSE)
1009997
expect_snapshot(sbm_game_impl(
1010998
n = 5,
1011-
pref.matrix = matrix(0.5,
1012-
2, 2),
999+
pref.matrix = matrix(0.5, 2, 2),
10131000
block.sizes = c(2, 3)
10141001
))
10151002
expect_snapshot(sbm_game_impl(
10161003
n = 5,
1017-
pref.matrix = matrix(0.5,
1018-
2, 2),
1004+
pref.matrix = matrix(0.5, 2, 2),
10191005
block.sizes = c(2, 3),
10201006
directed = TRUE,
10211007
loops = TRUE
@@ -1027,8 +1013,7 @@ test_that("sbm_game_impl errors", {
10271013
local_igraph_options(print.id = FALSE)
10281014
expect_snapshot_igraph_error(sbm_game_impl(
10291015
n = -1,
1030-
pref.matrix = matrix(0.5,
1031-
2, 2),
1016+
pref.matrix = matrix(0.5, 2, 2),
10321017
block.sizes = c(2, 3)
10331018
))
10341019
})
@@ -1042,8 +1027,7 @@ test_that("hsbm_game_impl basic", {
10421027
n = 6,
10431028
m = 2,
10441029
rho = c(0.5, 0.5),
1045-
C = matrix(1,
1046-
2, 2),
1030+
C = matrix(1, 2, 2),
10471031
p = 0.5
10481032
))
10491033
})
@@ -1056,8 +1040,7 @@ test_that("hsbm_game_impl errors", {
10561040
n = -1,
10571041
m = 2,
10581042
rho = 0.5,
1059-
C = matrix(1, 2,
1060-
2),
1043+
C = matrix(1, 2, 2),
10611044
p = 0.5
10621045
)
10631046
)
@@ -1103,10 +1086,8 @@ test_that("hsbm_list_game_impl errors", {
11031086
mlist = c(2, 3),
11041087
rholist = list(0.5, 0.5),
11051088
Clist = list(
1106-
matrix(1,
1107-
2, 2),
1108-
matrix(1,
1109-
2, 2)
1089+
matrix(1, 2, 2),
1090+
matrix(1, 2, 2)
11101091
),
11111092
p = 0.5
11121093
)
@@ -1171,12 +1152,10 @@ test_that("dot_product_game_impl basic", {
11711152
withr::local_seed(20250909)
11721153
local_igraph_options(print.id = FALSE)
11731154
expect_snapshot(dot_product_game_impl(
1174-
vecs = matrix(0.5,
1175-
5, 2)
1155+
vecs = matrix(0.5, 5, 2)
11761156
))
11771157
expect_snapshot(dot_product_game_impl(
1178-
vecs = matrix(0.5,
1179-
5, 2),
1158+
vecs = matrix(0.5, 5, 2),
11801159
directed = TRUE
11811160
))
11821161
})
@@ -3755,8 +3734,7 @@ test_that("edgelist_percolation_impl basic", {
37553734
withr::local_seed(20250909)
37563735
local_igraph_options(print.id = FALSE)
37573736
expect_snapshot(edgelist_percolation_impl(
3758-
edges = matrix(c(1,
3759-
2, 2, 3), ncol = 2)
3737+
edges = matrix(c(1, 2, 2, 3), ncol = 2)
37603738
))
37613739
})
37623740

@@ -4277,8 +4255,7 @@ test_that("layout_mds_impl basic", {
42774255
))
42784256
expect_snapshot(layout_mds_impl(
42794257
graph = g,
4280-
dist = matrix(1:9,
4281-
nrow = 3),
4258+
dist = matrix(1:9, nrow = 3),
42824259
dim = 3
42834260
))
42844261
})
@@ -4335,13 +4312,11 @@ test_that("layout_gem_impl basic", {
43354312

43364313
expect_snapshot(layout_gem_impl(
43374314
graph = g,
4338-
res = matrix(0, nrow = 3,
4339-
ncol = 2)
4315+
res = matrix(0, nrow = 3, ncol = 2)
43404316
))
43414317
expect_snapshot(layout_gem_impl(
43424318
graph = g,
4343-
res = matrix(0, nrow = 3,
4344-
ncol = 2),
4319+
res = matrix(0, nrow = 3, ncol = 2),
43454320
use.seed = TRUE,
43464321
maxiter = 10,
43474322
temp.max = 2,
@@ -4356,8 +4331,7 @@ test_that("layout_gem_impl errors", {
43564331
expect_snapshot_igraph_error(
43574332
layout_gem_impl(
43584333
graph = NULL,
4359-
res = matrix(0, nrow = 3,
4360-
ncol = 2)
4334+
res = matrix(0, nrow = 3, ncol = 2)
43614335
)
43624336
)
43634337
})
@@ -4373,13 +4347,11 @@ test_that("layout_davidson_harel_impl basic", {
43734347

43744348
expect_snapshot(layout_davidson_harel_impl(
43754349
graph = g,
4376-
res = matrix(0, nrow = 3,
4377-
ncol = 2)
4350+
res = matrix(0, nrow = 3, ncol = 2)
43784351
))
43794352
expect_snapshot(layout_davidson_harel_impl(
43804353
graph = g,
4381-
res = matrix(0, nrow = 3,
4382-
ncol = 2),
4354+
res = matrix(0, nrow = 3, ncol = 2),
43834355
use.seed = TRUE,
43844356
maxiter = 10,
43854357
fineiter = 5,
@@ -4398,8 +4370,7 @@ test_that("layout_davidson_harel_impl errors", {
43984370
expect_snapshot_igraph_error(
43994371
layout_davidson_harel_impl(
44004372
graph = NULL,
4401-
res = matrix(0, nrow = 3,
4402-
ncol = 2)
4373+
res = matrix(0, nrow = 3, ncol = 2)
44034374
)
44044375
)
44054376
})
@@ -4415,14 +4386,12 @@ test_that("layout_umap_impl basic", {
44154386

44164387
expect_snapshot(layout_umap_impl(
44174388
graph = g,
4418-
res = matrix(0, nrow = 3,
4419-
ncol = 2),
4389+
res = matrix(0, nrow = 3, ncol = 2),
44204390
use.seed = TRUE
44214391
))
44224392
expect_snapshot(layout_umap_impl(
44234393
graph = g,
4424-
res = matrix(0, nrow = 3,
4425-
ncol = 2),
4394+
res = matrix(0, nrow = 3, ncol = 2),
44264395
use.seed = TRUE,
44274396
distances = 1:3,
44284397
min.dist = 0.1,
@@ -4437,8 +4406,7 @@ test_that("layout_umap_impl errors", {
44374406
expect_snapshot_igraph_error(
44384407
layout_umap_impl(
44394408
graph = NULL,
4440-
res = matrix(0, nrow = 3,
4441-
ncol = 2)
4409+
res = matrix(0, nrow = 3, ncol = 2)
44424410
)
44434411
)
44444412
})
@@ -4454,14 +4422,12 @@ test_that("layout_umap_3d_impl basic", {
44544422

44554423
expect_snapshot(layout_umap_3d_impl(
44564424
graph = g,
4457-
res = matrix(0, nrow = 3,
4458-
ncol = 3),
4425+
res = matrix(0, nrow = 3, ncol = 3),
44594426
use.seed = TRUE
44604427
))
44614428
expect_snapshot(layout_umap_3d_impl(
44624429
graph = g,
4463-
res = matrix(0, nrow = 3,
4464-
ncol = 3),
4430+
res = matrix(0, nrow = 3, ncol = 3),
44654431
use.seed = TRUE,
44664432
distances = 1:3,
44674433
min.dist = 0.1,
@@ -4476,8 +4442,7 @@ test_that("layout_umap_3d_impl errors", {
44764442
expect_snapshot_igraph_error(
44774443
layout_umap_3d_impl(
44784444
graph = NULL,
4479-
res = matrix(0, nrow = 3,
4480-
ncol = 3)
4445+
res = matrix(0, nrow = 3, ncol = 3)
44814446
)
44824447
)
44834448
})
@@ -4521,8 +4486,7 @@ test_that("layout_align_impl basic", {
45214486

45224487
expect_snapshot(layout_align_impl(
45234488
graph = g,
4524-
layout = matrix(0,
4525-
nrow = 3, ncol = 2)
4489+
layout = matrix(0, nrow = 3, ncol = 2)
45264490
))
45274491
})
45284492

@@ -4532,8 +4496,7 @@ test_that("layout_align_impl errors", {
45324496
expect_snapshot_igraph_error(
45334497
layout_align_impl(
45344498
graph = NULL,
4535-
layout = matrix(0,
4536-
nrow = 3, ncol = 2)
4499+
layout = matrix(0, nrow = 3, ncol = 2)
45374500
)
45384501
)
45394502
})
@@ -4602,13 +4565,11 @@ test_that("similarity_dice_pairs_impl basic", {
46024565

46034566
expect_snapshot(similarity_dice_pairs_impl(
46044567
graph = g,
4605-
pairs = matrix(c(1,
4606-
2, 2, 3), ncol = 2)
4568+
pairs = matrix(c(1, 2, 2, 3), ncol = 2)
46074569
))
46084570
expect_snapshot(similarity_dice_pairs_impl(
46094571
graph = g,
4610-
pairs = matrix(c(1,
4611-
2, 2, 3), ncol = 2),
4572+
pairs = matrix(c(1, 2, 2, 3), ncol = 2),
46124573
mode = "in",
46134574
loops = TRUE
46144575
))
@@ -4620,8 +4581,7 @@ test_that("similarity_dice_pairs_impl errors", {
46204581
expect_snapshot_igraph_error(
46214582
similarity_dice_pairs_impl(
46224583
graph = NULL,
4623-
pairs = matrix(c(1,
4624-
2, 2, 3), ncol = 2)
4584+
pairs = matrix(c(1, 2, 2, 3), ncol = 2)
46254585
)
46264586
)
46274587
})
@@ -4717,13 +4677,11 @@ test_that("similarity_jaccard_pairs_impl basic", {
47174677

47184678
expect_snapshot(similarity_jaccard_pairs_impl(
47194679
graph = g,
4720-
pairs = matrix(c(1,
4721-
2, 2, 3), ncol = 2)
4680+
pairs = matrix(c(1, 2, 2, 3), ncol = 2)
47224681
))
47234682
expect_snapshot(similarity_jaccard_pairs_impl(
47244683
graph = g,
4725-
pairs = matrix(c(1,
4726-
2, 2, 3), ncol = 2),
4684+
pairs = matrix(c(1, 2, 2, 3), ncol = 2),
47274685
mode = "in",
47284686
loops = TRUE
47294687
))
@@ -4735,8 +4693,7 @@ test_that("similarity_jaccard_pairs_impl errors", {
47354693
expect_snapshot_igraph_error(
47364694
similarity_jaccard_pairs_impl(
47374695
graph = NULL,
4738-
pairs = matrix(c(1,
4739-
2, 2, 3), ncol = 2)
4696+
pairs = matrix(c(1, 2, 2, 3), ncol = 2)
47404697
)
47414698
)
47424699
})
@@ -7174,8 +7131,7 @@ test_that("solve_lsap_impl basic", {
71747131
withr::local_seed(20250909)
71757132
local_igraph_options(print.id = FALSE)
71767133
expect_snapshot(solve_lsap_impl(
7177-
c = matrix(1:4,
7178-
ncol = 2),
7134+
c = matrix(1:4, ncol = 2),
71797135
n = 2
71807136
))
71817137
})

0 commit comments

Comments
 (0)