From d79f816cc19af0331f759bc364b61ec34b436c1a Mon Sep 17 00:00:00 2001 From: Aaron L Date: Tue, 24 Jan 2017 23:03:59 -0800 Subject: [PATCH] Fix test failure - Optimistic code removed. It wasn't possible to test for this condition ever. --- templates_test/relationship_to_many_setops.tpl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/templates_test/relationship_to_many_setops.tpl b/templates_test/relationship_to_many_setops.tpl index 01471f4..f66ba8a 100644 --- a/templates_test/relationship_to_many_setops.tpl +++ b/templates_test/relationship_to_many_setops.tpl @@ -159,12 +159,16 @@ func test{{$txt.LocalTable.NameGo}}ToManySetOp{{$txt.Function.Name}}(t *testing. {{- if .ToJoinTable}} - if len(b.R.{{$txt.Function.ForeignName}}) != 0 { - t.Error("relationship was not removed properly from the slice") - } - if len(c.R.{{$txt.Function.ForeignName}}) != 0 { - t.Error("relationship was not removed properly from the slice") - } + // The following checks cannot be implemented since we have no handle + // to these when we call Set(). Leaving them here as wishful thinking + // and to let people know there's dragons. + // + // if len(b.R.{{$txt.Function.ForeignName}}) != 0 { + // t.Error("relationship was not removed properly from the slice") + // } + // if len(c.R.{{$txt.Function.ForeignName}}) != 0 { + // t.Error("relationship was not removed properly from the slice") + // } if d.R.{{$txt.Function.ForeignName}}[0] != &a { t.Error("relationship was not added properly to the slice") }