Skip to content

Commit

Permalink
Update how to update test assets
Browse files Browse the repository at this point in the history
  • Loading branch information
git-hulk committed Nov 2, 2023
1 parent 6d29560 commit 6c7f267
Show file tree
Hide file tree
Showing 4 changed files with 474 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ $(PROGRAM):
test:
@go test -v ./... -covermode=atomic -coverprofile=coverage.out -race -compatible

update_test:
@go test -v ./... -update -race -compatible

lint:
@printf $(CCCOLOR)"GolangCI Lint...\n"$(ENDCOLOR)
@golangci-lint run --timeout 20m0s
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ $ clickhouse-sql-parser -format "SELECT * FROM clickhouse WHERE a=100"
## Parse query from file
$ clickhouse-sql-parser -file ./test.sql
```
## Update test assets

For the files inside `output` and `format` dir are generated by the test cases,

if you want to update them, you can run the following command:

```bash
$ make update_test
```

## Contact us

Expand Down
18 changes: 18 additions & 0 deletions parser/testdata/ddl/format/grant_privilege.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- Origin SQL:
GRANT SELECT(x,y) ON db.table TO john;
GRANT SELECT(x,y) ON db.table TO john WITH GRANT OPTION WITH ADMIN OPTION;
GRANT SELECT(x,y) ON db.* TO john;
GRANT SELECT(x,y) ON *.table TO john;
GRANT SELECT(x,y) ON *.* TO john;
GRANT SELECT(x,y) ON *.table TO CURRENT_USER;
GRANT SELECT(x,y) ON *.table TO CURRENT_USER,john,mary;


-- Format SQL:
GRANT SELECT(x, y) ON db.table TO john;
GRANT SELECT(x, y) ON db.table TO john WITH GRANT OPTION WITH ADMIN OPTION;
GRANT SELECT(x, y) ON db.* TO john;
GRANT SELECT(x, y) ON *.table TO john;
GRANT SELECT(x, y) ON *.* TO john;
GRANT SELECT(x, y) ON *.table TO CURRENT_USER;
GRANT SELECT(x, y) ON *.table TO CURRENT_USER, john, mary;
Loading

0 comments on commit 6c7f267

Please sign in to comment.