Skip to content

TestIsEmptyClause fails #51

@chrisdusovic

Description

@chrisdusovic

In bql/semantic/semantic_test.go, there is a typo in a test name that causes it to be ignored:

func TesIsEmptyClause(t *testing.T) {
    testTable := []struct {
        in  *GraphClause
        out bool
    }{
        {
            in:  &GraphClause{},
            out: true,
        },
        {
            in:  &GraphClause{SBinding: "?foo"},
            out: true,
        },
    }
    for _, entry := range testTable {
        if got, want := entry.in.IsEmpty(), entry.out; got != want {
            t.Errorf("IsEmpty for %v returned %v, but should have returned %v", entry.in, got, want)
        }
    }

}

After changing the name to the proper TestIsEmptyClause and running the tests, the test fails:

--- FAIL: TestIsEmptyClause (0.00s)
    semantic_test.go:148: IsEmpty for &{<nil> ?foo    <nil>       <nil> <nil>   false <nil>        <nil> <nil>   false} returned false, but should have returned true
FAIL
FAIL    github.com/google/badwolf/bql/semantic  0.028s

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions