~mna/snow

ref: 51726a5ef2959dd97add58914fe45d829880e258 snow/pkg/grammar/grammar_test.go -rw-r--r-- 361 bytes
51726a5eMartin Angers Merge branch 'wip-static-func-return' 1 year, 11 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package grammar

import (
	"os"
	"testing"

	"golang.org/x/exp/ebnf"
)

func TestEBNF(t *testing.T) {
	const filename = "grammar.ebnf"
	f, err := os.Open(filename)
	if err != nil {
		t.Fatal(err)
	}
	defer f.Close()

	g, err := ebnf.Parse(filename, f)
	if err != nil {
		t.Fatal(err)
	}
	if err := ebnf.Verify(g, "SourceFile"); err != nil {
		t.Fatal(err)
	}
}