func TestSplitDomainByFloatingAnchor(t *testing.T) { for i, it := range aitems { subname, basename, rootname, err := util.SplitDomainByFloatingAnchor(it.input, it.anchor) if subname != it.expectedSubname { t.Errorf("Item %d: subname \"%s\" does not equal expected value \"%s\"", i, subname, it.expectedSubname) } if basename != it.expectedBasename { t.Errorf("Item %d: basename \"%s\" does not equal expected value \"%s\"", i, basename, it.expectedBasename) } if rootname != it.expectedRootname { t.Errorf("Item %d: rootname \"%s\" does not equal expected value \"%s\"", i, basename, it.expectedRootname) } if err != it.expectedError { t.Errorf("Item %d: error \"%s\" does not equal expected error \"%s\"", i, err, it.expectedError) } } }
func (tx *btx) determineDomain() (subname, basename, rootname string, err error) { return util.SplitDomainByFloatingAnchor(tx.qname, "bit") }