MCPcopy Create free account
hub / github.com/docopt/docopt.go / TestPatternFixIdentities1

Function TestPatternFixIdentities1

docopt_test.go:1023–1040  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1021}
1022
1023func TestPatternFixIdentities1(t *testing.T) {
1024 p := newRequired(
1025 newArgument("N", nil),
1026 newArgument("N", nil))
1027 if len(p.children) < 2 {
1028 t.FailNow()
1029 }
1030 if p.children[0].eq(p.children[1]) != true {
1031 t.Fail()
1032 }
1033 if p.children[0] == p.children[1] {
1034 t.Fail()
1035 }
1036 p.fixIdentities(nil)
1037 if p.children[0] != p.children[1] {
1038 t.Fail()
1039 }
1040}
1041
1042func TestPatternFixIdentities2(t *testing.T) {
1043 p := newRequired(

Callers

nothing calls this directly

Calls 4

newRequiredFunction · 0.85
newArgumentFunction · 0.85
fixIdentitiesMethod · 0.80
eqMethod · 0.45

Tested by

no test coverage detected