mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-10 00:20:00 +08:00
fix syntax of the key expression (#4586)
This commit is contained in:
@@ -581,8 +581,8 @@ func TestScanner_NextToken_Key(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
Type: token.KEY,
|
||||
Text: "foo:",
|
||||
Type: token.IDENT,
|
||||
Text: "foo",
|
||||
Position: token.Position{
|
||||
Filename: "foo.api",
|
||||
Line: 2,
|
||||
@@ -590,14 +590,32 @@ func TestScanner_NextToken_Key(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
Type: token.KEY,
|
||||
Text: "bar:",
|
||||
Type: token.COLON,
|
||||
Text: ":",
|
||||
Position: token.Position{
|
||||
Filename: "foo.api",
|
||||
Line: 2,
|
||||
Column: 4,
|
||||
},
|
||||
},
|
||||
{
|
||||
Type: token.IDENT,
|
||||
Text: "bar",
|
||||
Position: token.Position{
|
||||
Filename: "foo.api",
|
||||
Line: 3,
|
||||
Column: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
Type: token.COLON,
|
||||
Text: ":",
|
||||
Position: token.Position{
|
||||
Filename: "foo.api",
|
||||
Line: 3,
|
||||
Column: 4,
|
||||
},
|
||||
},
|
||||
{
|
||||
Type: token.COLON,
|
||||
Text: ":",
|
||||
@@ -1090,50 +1108,75 @@ func TestScanner_NextToken(t *testing.T) {
|
||||
Position: position(3, 5),
|
||||
},
|
||||
{
|
||||
Type: token.KEY,
|
||||
Text: `title:`,
|
||||
Type: token.IDENT,
|
||||
Text: `title`,
|
||||
Position: position(4, 5),
|
||||
},
|
||||
{
|
||||
Type: token.COLON,
|
||||
Text: `:`,
|
||||
Position: position(4, 10),
|
||||
},
|
||||
{
|
||||
Type: token.STRING,
|
||||
Text: `"type title here"`,
|
||||
Position: position(4, 12),
|
||||
},
|
||||
{
|
||||
Type: token.KEY,
|
||||
Text: `desc:`,
|
||||
Type: token.IDENT,
|
||||
Text: `desc`,
|
||||
Position: position(5, 5),
|
||||
},
|
||||
{
|
||||
Type: token.COLON,
|
||||
Text: `:`,
|
||||
Position: position(5, 9),
|
||||
},
|
||||
{
|
||||
Type: token.STRING,
|
||||
Text: `"type desc here"`,
|
||||
Position: position(5, 11),
|
||||
},
|
||||
{
|
||||
Type: token.KEY,
|
||||
Text: `author:`,
|
||||
Type: token.IDENT,
|
||||
Text: `author`,
|
||||
Position: position(6, 5),
|
||||
},
|
||||
{
|
||||
Type: token.COLON,
|
||||
Text: `:`,
|
||||
Position: position(6, 11),
|
||||
},
|
||||
{
|
||||
Type: token.STRING,
|
||||
Text: `"type author here"`,
|
||||
Position: position(6, 13),
|
||||
},
|
||||
{
|
||||
Type: token.KEY,
|
||||
Text: `email:`,
|
||||
Type: token.IDENT,
|
||||
Text: `email`,
|
||||
Position: position(7, 5),
|
||||
},
|
||||
{
|
||||
Type: token.COLON,
|
||||
Text: `:`,
|
||||
Position: position(7, 10),
|
||||
},
|
||||
{
|
||||
Type: token.STRING,
|
||||
Text: `"type email here"`,
|
||||
Position: position(7, 12),
|
||||
},
|
||||
{
|
||||
Type: token.KEY,
|
||||
Text: `version:`,
|
||||
Type: token.IDENT,
|
||||
Text: `version`,
|
||||
Position: position(8, 5),
|
||||
},
|
||||
{
|
||||
Type: token.COLON,
|
||||
Text: `:`,
|
||||
Position: position(8, 12),
|
||||
},
|
||||
{
|
||||
Type: token.STRING,
|
||||
Text: `"type version here"`,
|
||||
@@ -1205,20 +1248,30 @@ func TestScanner_NextToken(t *testing.T) {
|
||||
Position: position(20, 8),
|
||||
},
|
||||
{
|
||||
Type: token.KEY,
|
||||
Text: `jwt:`,
|
||||
Type: token.IDENT,
|
||||
Text: `jwt`,
|
||||
Position: position(21, 5),
|
||||
},
|
||||
{
|
||||
Type: token.COLON,
|
||||
Text: `:`,
|
||||
Position: position(21, 8),
|
||||
},
|
||||
{
|
||||
Type: token.IDENT,
|
||||
Text: `Auth`,
|
||||
Position: position(21, 10),
|
||||
},
|
||||
{
|
||||
Type: token.KEY,
|
||||
Text: `group:`,
|
||||
Type: token.IDENT,
|
||||
Text: `group`,
|
||||
Position: position(22, 5),
|
||||
},
|
||||
{
|
||||
Type: token.COLON,
|
||||
Text: `:`,
|
||||
Position: position(22, 10),
|
||||
},
|
||||
{
|
||||
Type: token.IDENT,
|
||||
Text: `template`,
|
||||
|
||||
Reference in New Issue
Block a user