(t *testing.T)
| 1322 | } |
| 1323 | |
| 1324 | func TestNilFunction(t *testing.T) { |
| 1325 | var f *FunctionDecl |
| 1326 | if f.Name() != "" { |
| 1327 | t.Errorf("f.Name() got %s, wanted ''", f.Name()) |
| 1328 | } |
| 1329 | if f.Description() != "" { |
| 1330 | t.Errorf("f.Description() got %s, wanted ''", f.Description()) |
| 1331 | } |
| 1332 | if f.Documentation() != nil { |
| 1333 | t.Errorf("f.Documentation() got %v, wanted nil", f.Documentation()) |
| 1334 | } |
| 1335 | if !f.IsDeclarationDisabled() { |
| 1336 | t.Errorf("f.IsDeclarationDisabled() got %t, wanted true", f.IsDeclarationDisabled()) |
| 1337 | } |
| 1338 | if len(f.OverloadDecls()) != 0 { |
| 1339 | t.Errorf("f.OverloadDecls() got %d overloads, wanted 0", len(f.OverloadDecls())) |
| 1340 | } |
| 1341 | if b, err := f.Bindings(); err != nil || len(b) != 0 { |
| 1342 | t.Error("f.Bindings() got non-empty result") |
| 1343 | } |
| 1344 | other := &FunctionDecl{} |
| 1345 | if fn, err := f.Merge(other); err == nil { |
| 1346 | t.Errorf("f.Merge(nil) wanted error, got %v", fn) |
| 1347 | } |
| 1348 | if err := f.AddOverload(nil); err == nil { |
| 1349 | t.Error("f.AddOverload(nil) did not error") |
| 1350 | } |
| 1351 | if err := other.AddOverload(nil); err == nil { |
| 1352 | t.Error("f.AddOverload(nil) did not error") |
| 1353 | } |
| 1354 | } |
| 1355 | |
| 1356 | func TestNilVariable(t *testing.T) { |
| 1357 | var v *VariableDecl |
nothing calls this directly
no test coverage detected