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