ast_test.go 395 B

123456789101112131415161718192021
  1. package muesli
  2. import "testing"
  3. func TestAstKind(test *testing.T) {
  4. var kind AstKind = AstKindError
  5. errast := NewEmptyAst(AstKindError)
  6. astnone := NewAstNone()
  7. if kind != AstKindError {
  8. test.Errorf("Error is not error: %v", kind)
  9. }
  10. if !errast.IsError() {
  11. test.Errorf("Error is not error: %v", errast)
  12. }
  13. if !astnone.IsNone() {
  14. test.Errorf("None is not none: %v", astnone)
  15. }
  16. }