Skip to content

Commit 6c7f267

Browse files
committed
Update how to update test assets
1 parent 6d29560 commit 6c7f267

File tree

4 files changed

+474
-0
lines changed

4 files changed

+474
-0
lines changed

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ $(PROGRAM):
1616
test:
1717
@go test -v ./... -covermode=atomic -coverprofile=coverage.out -race -compatible
1818

19+
update_test:
20+
@go test -v ./... -update -race -compatible
21+
1922
lint:
2023
@printf $(CCCOLOR)"GolangCI Lint...\n"$(ENDCOLOR)
2124
@golangci-lint run --timeout 20m0s

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ $ clickhouse-sql-parser -format "SELECT * FROM clickhouse WHERE a=100"
4747
## Parse query from file
4848
$ clickhouse-sql-parser -file ./test.sql
4949
```
50+
## Update test assets
51+
52+
For the files inside `output` and `format` dir are generated by the test cases,
53+
54+
if you want to update them, you can run the following command:
55+
56+
```bash
57+
$ make update_test
58+
```
5059

5160
## Contact us
5261

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
-- Origin SQL:
2+
GRANT SELECT(x,y) ON db.table TO john;
3+
GRANT SELECT(x,y) ON db.table TO john WITH GRANT OPTION WITH ADMIN OPTION;
4+
GRANT SELECT(x,y) ON db.* TO john;
5+
GRANT SELECT(x,y) ON *.table TO john;
6+
GRANT SELECT(x,y) ON *.* TO john;
7+
GRANT SELECT(x,y) ON *.table TO CURRENT_USER;
8+
GRANT SELECT(x,y) ON *.table TO CURRENT_USER,john,mary;
9+
10+
11+
-- Format SQL:
12+
GRANT SELECT(x, y) ON db.table TO john;
13+
GRANT SELECT(x, y) ON db.table TO john WITH GRANT OPTION WITH ADMIN OPTION;
14+
GRANT SELECT(x, y) ON db.* TO john;
15+
GRANT SELECT(x, y) ON *.table TO john;
16+
GRANT SELECT(x, y) ON *.* TO john;
17+
GRANT SELECT(x, y) ON *.table TO CURRENT_USER;
18+
GRANT SELECT(x, y) ON *.table TO CURRENT_USER, john, mary;

0 commit comments

Comments
 (0)