You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letactual=match test with Some t -> attrText t | None ->"missing"
45
+
letexpected=match control with Some t -> attrText t | None ->"missing"
46
+
$"""
47
+
48
+
expected: {expected}
49
+
actual: {actual}
50
+
"""
51
+
52
+
match source with
53
+
|:? NodeDiff as diff -> nodeDiffText <| Some diff.Control <| Some diff.Test
54
+
|:? AttrDiff as diff -> attrDiffText <| Some diff.Control <| Some diff.Test
55
+
|:? MissingNodeDiff as diff -> nodeDiffText <| Some diff.Control <| None
56
+
|:? MissingAttrDiff as diff -> attrDiffText <| Some diff.Control <| None
57
+
|:? UnexpectedNodeDiff as diff -> nodeDiffText None <| Some diff.Test
58
+
|:? UnexpectedAttrDiff as diff -> attrDiffText None <| Some diff.Test
59
+
|_-> failwith $"Unknown diff type detected: {source.GetType()}"
60
+
61
+
diffs
62
+
|> Seq.map (fun diff ->
63
+
64
+
match diff with
65
+
|:? NodeDiff as diff when diff.Target = DiffTarget.Text && diff.Control.Path.Equals(diff.Test.Path, StringComparison.Ordinal)
66
+
-> $"The text in {diff.Control.Path} is different."
67
+
|:? NodeDiff as diff when diff.Target = DiffTarget.Text
68
+
-> $"The expected {NodeName(diff.Control)} at {diff.Control.Path} and the actual {NodeName(diff.Test)} at {diff.Test.Path} is different."
69
+
|:? NodeDiff as diff when diff.Control.Path.Equals(diff.Test.Path, StringComparison.Ordinal)
70
+
-> $"The {NodeName(diff.Control)}s at {diff.Control.Path} are different."
71
+
|:? NodeDiff as diff -> $"The expected {NodeName(diff.Control)} at {diff.Control.Path} and the actual {NodeName(diff.Test)} at {diff.Test.Path} are different."
72
+
|:? AttrDiff as diff when diff.Control.Path.Equals(diff.Test.Path, StringComparison.Ordinal)
73
+
-> $"The values of the attributes at {diff.Control.Path} are different."
74
+
|:? AttrDiff as diff -> $"The value of the attribute {diff.Control.Path} and actual attribute {diff.Test.Path} are different."
75
+
|:? MissingNodeDiff as diff -> $"The {NodeName(diff.Control)} at {diff.Control.Path} is missing."
76
+
|:? MissingAttrDiff as diff -> $"The attribute at {diff.Control.Path} is missing."
77
+
|:? UnexpectedNodeDiff as diff -> $"The {NodeName(diff.Test)} at {diff.Test.Path} was not expected."
78
+
|:? UnexpectedAttrDiff as diff -> $"The attribute at {diff.Test.Path} was not expected."
79
+
|_-> failwith $"Unknown diff type detected: {diff.GetType()}"
0 commit comments