Stop depending on nil vs empty slice in a test.

It should not make the difference.
This commit is contained in:
Stanisław Barzowski 2021-05-14 20:59:33 +02:00
parent 5899996502
commit ba5dc76509

View File

@ -28,7 +28,7 @@ func TestSimpleNull(t *testing.T) {
if err != nil {
t.Errorf("Unexpected error: %+v", err)
}
if ast.FreeVariables() != nil {
if len(ast.FreeVariables()) != 0 {
t.Errorf("Unexpected free variabled %+v", ast.FreeVariables())
}
}
@ -60,7 +60,7 @@ func TestSimpleLocal(t *testing.T) {
if err != nil {
t.Errorf("Unexpected error: %+v", err)
}
if node.FreeVariables() != nil {
if len(node.FreeVariables()) != 0 {
t.Errorf("Unexpected free variables %+v in root local. Expected none.", node.FreeVariables())
}
returned := node.Body.FreeVariables()