Skip to content

Commit f84346f

Browse files
Update tests
1 parent f9f7418 commit f84346f

File tree

2 files changed

+47
-47
lines changed

2 files changed

+47
-47
lines changed

β€Žtest/topologies.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ end
502502
t = HalfEdgeTopology(e)
503503
test_halfedge(e, t)
504504
n = collect(elements(t))
505-
@test n == connect.([(5, 4, 1), (6, 2, 4), (6, 5, 3), (4, 5, 6)])
505+
@test n == connect.([(4, 1, 5), (4, 6, 2), (6, 5, 3), (4, 5, 6)])
506506

507507
e = connect.([(1, 2, 3), (1, 3, 4), (2, 5, 3), (5, 4, 6), (3, 5, 4)])
508508
t = HalfEdgeTopology(e)
@@ -511,8 +511,8 @@ end
511511
# indexable api
512512
g = GridTopology(10, 10)
513513
t = convert(HalfEdgeTopology, g)
514-
@test t[begin] == connect((13, 12, 1, 2), Quadrangle)
515-
@test t[end] == connect((110, 121, 120, 109), Quadrangle)
514+
@test t[begin] == g[begin]
515+
@test t[end] == connect((120, 109, 110, 121), Quadrangle)
516516
@test t[10] == connect((22, 21, 10, 11), Quadrangle)
517517
@test length(t) == 100
518518
@test eltype(t) == Connectivity{Quadrangle,4}

β€Žtest/toporelations.jl

+44-44
Original file line numberDiff line numberDiff line change
@@ -445,30 +445,30 @@ end
445445
elems = connect.([(1, 2, 3), (4, 3, 2)])
446446
t = HalfEdgeTopology(elems)
447447
βˆ‚ = Boundary{2,0}(t)
448-
@test βˆ‚(1) == (2, 3, 1)
448+
@test βˆ‚(1) == (1, 2, 3)
449449
@test βˆ‚(2) == (3, 2, 4)
450450
βˆ‚ = Boundary{2,1}(t)
451-
@test βˆ‚(1) == (1, 3, 2)
452-
@test βˆ‚(2) == (1, 4, 5)
451+
@test βˆ‚(1) == (1, 2, 3)
452+
@test βˆ‚(2) == (2, 5, 4)
453453
βˆ‚ = Boundary{1,0}(t)
454-
@test βˆ‚(1) == (3, 2)
455-
@test βˆ‚(2) == (1, 2)
454+
@test βˆ‚(1) == (1, 2)
455+
@test βˆ‚(2) == (2, 3)
456456
@test βˆ‚(3) == (3, 1)
457-
@test βˆ‚(4) == (2, 4)
458-
@test βˆ‚(5) == (4, 3)
457+
@test βˆ‚(4) == (4, 3)
458+
@test βˆ‚(5) == (2, 4)
459459
π’ž = Coboundary{0,1}(t)
460-
@test π’ž(1) == (2, 3)
461-
@test π’ž(2) == (4, 1, 2)
462-
@test π’ž(3) == (3, 1, 5)
463-
@test π’ž(4) == (5, 4)
460+
@test π’ž(1) == (1, 3)
461+
@test π’ž(2) == (5, 2, 1)
462+
@test π’ž(3) == (3, 2, 4)
463+
@test π’ž(4) == (4, 5)
464464
π’ž = Coboundary{0,2}(t)
465465
@test π’ž(1) == (1,)
466466
@test π’ž(2) == (2, 1)
467467
@test π’ž(3) == (1, 2)
468468
@test π’ž(4) == (2,)
469469
π’ž = Coboundary{1,2}(t)
470-
@test π’ž(1) == (2, 1)
471-
@test π’ž(2) == (1,)
470+
@test π’ž(1) == (1,)
471+
@test π’ž(2) == (1, 2)
472472
@test π’ž(3) == (1,)
473473
@test π’ž(4) == (2,)
474474
@test π’ž(5) == (2,)
@@ -484,30 +484,30 @@ end
484484
βˆ‚ = Boundary{2,0}(t)
485485
@test βˆ‚(1) == (1, 2, 6, 5)
486486
@test βˆ‚(2) == (6, 2, 4)
487-
@test βˆ‚(3) == (6, 4, 3, 5)
488-
@test βˆ‚(4) == (3, 1, 5)
487+
@test βˆ‚(3) == (5, 6, 4, 3)
488+
@test βˆ‚(4) == (1, 5, 3)
489489
βˆ‚ = Boundary{2,1}(t)
490-
@test βˆ‚(1) == (1, 3, 5, 6)
491-
@test βˆ‚(2) == (3, 9, 4)
492-
@test βˆ‚(3) == (4, 7, 8, 5)
493-
@test βˆ‚(4) == (2, 6, 8)
490+
@test βˆ‚(1) == (1, 2, 3, 4)
491+
@test βˆ‚(2) == (2, 7, 8)
492+
@test βˆ‚(3) == (3, 8, 9, 5)
493+
@test βˆ‚(4) == (4, 5, 6)
494494
βˆ‚ = Boundary{1,0}(t)
495495
@test βˆ‚(1) == (1, 2)
496-
@test βˆ‚(2) == (3, 1)
497-
@test βˆ‚(3) == (6, 2)
498-
@test βˆ‚(4) == (4, 6)
499-
@test βˆ‚(5) == (5, 6)
500-
@test βˆ‚(6) == (1, 5)
501-
@test βˆ‚(7) == (4, 3)
502-
@test βˆ‚(8) == (3, 5)
503-
@test βˆ‚(9) == (2, 4)
496+
@test βˆ‚(2) == (2, 6)
497+
@test βˆ‚(3) == (6, 5)
498+
@test βˆ‚(4) == (5, 1)
499+
@test βˆ‚(5) == (5, 3)
500+
@test βˆ‚(6) == (3, 1)
501+
@test βˆ‚(7) == (2, 4)
502+
@test βˆ‚(8) == (4, 6)
503+
@test βˆ‚(9) == (4, 3)
504504
π’ž = Coboundary{0,1}(t)
505-
@test π’ž(1) == (1, 6, 2)
506-
@test π’ž(2) == (9, 3, 1)
507-
@test π’ž(3) == (2, 8, 7)
508-
@test π’ž(4) == (7, 4, 9)
509-
@test π’ž(5) == (5, 8, 6)
510-
@test π’ž(6) == (3, 4, 5)
505+
@test π’ž(1) == (1, 4, 6)
506+
@test π’ž(2) == (7, 2, 1)
507+
@test π’ž(3) == (6, 5, 9)
508+
@test π’ž(4) == (9, 8, 7)
509+
@test π’ž(5) == (3, 5, 4)
510+
@test π’ž(6) == (2, 8, 3)
511511
π’ž = Coboundary{0,2}(t)
512512
@test π’ž(1) == (1, 4)
513513
@test π’ž(2) == (2, 1)
@@ -517,14 +517,14 @@ end
517517
@test π’ž(6) == (2, 3, 1)
518518
π’ž = Coboundary{1,2}(t)
519519
@test π’ž(1) == (1,)
520-
@test π’ž(2) == (4,)
521-
@test π’ž(3) == (2, 1)
522-
@test π’ž(4) == (2, 3)
523-
@test π’ž(5) == (3, 1)
524-
@test π’ž(6) == (4, 1)
525-
@test π’ž(7) == (3,)
526-
@test π’ž(8) == (3, 4)
527-
@test π’ž(9) == (2,)
520+
@test π’ž(2) == (1, 2)
521+
@test π’ž(3) == (1, 3)
522+
@test π’ž(4) == (1, 4)
523+
@test π’ž(5) == (4, 3)
524+
@test π’ž(6) == (4,)
525+
@test π’ž(7) == (2,)
526+
@test π’ž(8) == (2, 3)
527+
@test π’ž(9) == (3,)
528528
π’œ = Adjacency{0}(t)
529529
@test π’œ(1) == (2, 5, 3)
530530
@test π’œ(2) == (4, 6, 1)
@@ -539,17 +539,17 @@ end
539539
π’œ = Adjacency{2}(t)
540540
@test π’œ(1) == (2, 3, 4)
541541
@test π’œ(2) == (1, 3)
542-
@test π’œ(3) == (2, 4, 1)
542+
@test π’œ(3) == (1, 2, 4)
543543
@test π’œ(4) == (1, 3)
544544

545545
# 4 quadrangles in a grid
546546
elems = connect.([(1, 2, 5, 4), (2, 3, 6, 5), (4, 5, 8, 7), (5, 6, 9, 8)])
547547
t = HalfEdgeTopology(elems)
548548
π’œ = Adjacency{2}(t)
549-
@test π’œ(1) == (3, 2)
549+
@test π’œ(1) == (2, 3)
550550
@test π’œ(2) == (1, 4)
551551
@test π’œ(3) == (1, 4)
552-
@test π’œ(4) == (3, 2)
552+
@test π’œ(4) == (2, 3)
553553

554554
# invalid relations
555555
elems = connect.([(1, 2, 3), (4, 3, 2)])

0 commit comments

Comments
Β (0)