-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathHypergraphUnificationsPlot.wlt
More file actions
119 lines (103 loc) · 3.46 KB
/
Copy pathHypergraphUnificationsPlot.wlt
File metadata and controls
119 lines (103 loc) · 3.46 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<|
"HypergraphUnificationsPlot" -> <|
"init" -> (
Attributes[Global`testUnevaluated] = Attributes[Global`testSymbolLeak] = {HoldAll};
Global`testUnevaluated[args___] := SetReplace`PackageScope`testUnevaluated[VerificationTest, args];
Global`testSymbolLeak[args___] := SetReplace`PackageScope`testSymbolLeak[VerificationTest, args];
Global`checkGraphics[args___] := SetReplace`PackageScope`checkGraphics[args];
Global`graphicsQ[args___] := SetReplace`PackageScope`graphicsQ[args];
),
"tests" -> {
testSymbolLeak[
HypergraphUnificationsPlot[{{1, 2}, {2, 3}, {3, 4, 5}}, {{a, b}, {b, c}, {c, d, e}}]
],
testUnevaluated[
HypergraphUnificationsPlot[],
{HypergraphUnificationsPlot::argrx}
],
testUnevaluated[
HypergraphUnificationsPlot[1],
{HypergraphUnificationsPlot::argr}
],
testUnevaluated[
HypergraphUnificationsPlot[1, 2, 3],
{HypergraphUnificationsPlot::argrx}
],
testUnevaluated[
HypergraphUnificationsPlot[{1}, 2],
{HypergraphUnifications::hypergraphNotList}
],
testUnevaluated[
HypergraphUnificationsPlot[{1}, {2}],
{HypergraphUnifications::edgeNotList}
],
testUnevaluated[
HypergraphUnificationsPlot[{{1, 2, 3}}, {{a, b, c}}, "$$invalid$$" -> 0],
{OptionValue::nodef}
],
VerificationTest[
graphicsQ /@ HypergraphUnificationsPlot[{{1}}, {{2}}],
ConstantArray[True, Length[HypergraphUnifications[{{1}}, {{2}}]]]
],
VerificationTest[
HypergraphUnificationsPlot[{}, {}, VertexLabels -> Automatic],
{}
],
testUnevaluated[
HypergraphUnificationsPlot[{{}}, {{1}}, VertexLabels -> Automatic],
{HypergraphUnificationsPlot::emptyEdge}
],
testUnevaluated[
HypergraphUnificationsPlot[{{}}, {{}}, VertexLabels -> Automatic],
{HypergraphUnificationsPlot::emptyEdge}
],
VerificationTest[
graphicsQ /@ HypergraphUnificationsPlot[{{1, 2, 3}, {3, 4, 5}}, {{a, b, c}}, VertexSize -> 0.3],
{True, True}
],
testUnevaluated[
HypergraphUnificationsPlot[{{1, 2, 3}, {3, 4, 5}}, {{a, b, c}}, VertexSize -> -1],
{HypergraphPlot::invalidSize}
],
VerificationTest[
0 < Length @ Cases[
Cases[
checkGraphics @ HypergraphUnificationsPlot[{{x, y}, {x, z}}, {{a, b}, {b, c}}, VertexLabels -> Automatic],
_Text,
All],
#,
All]
] & /@ {_Style, _Row, ","},
VerificationTest[
Cases[
Cases[
checkGraphics @ HypergraphUnificationsPlot[{{x, y}, {x, z}}, {{a, b}, {b, c}}, VertexLabels -> 1],
_Text,
All],
_Style,
All],
{}
],
With[{color = RGBColor[0.76, 0.65, 0.73]},
VerificationTest[
Length @ Cases[
checkGraphics @
HypergraphUnificationsPlot[{{x, y}, {x, z}}, {{a, b}, {b, c}}, EdgeStyle -> color],
color,
All] > 0
]
],
VerificationTest[
Greater @@ (
Length @ Union @ Cases[
checkGraphics @ HypergraphUnificationsPlot[{{x, y}, {x, z}}, {{a, b}, {b, c}}, EdgeStyle -> #],
_ ? ColorQ,
All] & /@
{Automatic, RGBColor[0.252, 0.351, 0.143]})
]
},
"options" -> {
"Parallel" -> False
}
|>
|>