Skip to content

Commit

Permalink
fix: fix test case
Browse files Browse the repository at this point in the history
Signed-off-by: zongz <[email protected]>
  • Loading branch information
zong-zhe committed Feb 10, 2025
1 parent ef8ac48 commit c2c8977
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion pkg/tools/gen/genkcl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package gen

import (
"bytes"
"fmt"
"log"
"os"
"path/filepath"
Expand Down Expand Up @@ -142,11 +143,14 @@ func TestGenKclFromJsonSchema(t *testing.T) {
for _, testcase := range cases {
t.Run(testcase.name, func(t *testing.T) {
var buf bytes.Buffer
err := GenKcl(&buf, testcase.input, nil, &GenKclOptions{})
err := GenKcl(&buf, testcase.input, nil, &GenKclOptions{
Mode: ModeJsonSchema,
})
if err != nil {
t.Fatal(err)
}
result := buf.Bytes()
fmt.Printf("result: %v\n", string(result))
assert2.Equal(t, testcase.expect, string(bytes.ReplaceAll(result, []byte("\r\n"), []byte("\n"))))
})
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/tools/gen/testdata/jsonschema/document_quota/expect.k
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ This file was generated by the KCL auto-gen tool. DO NOT EDIT.
Editing this file might prove futile when you re-run the KCL auto-gen generate command.
"""

schema Demo:
schema Input:
r"""
Demo
Input

Attributes
----------
Expand Down

0 comments on commit c2c8977

Please sign in to comment.