unit test
This commit is contained in:
@ -8,8 +8,9 @@
|
||||
package filter
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"git.zhangdeman.cn/zhangdeman/util"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
@ -20,6 +21,7 @@ import (
|
||||
//
|
||||
// Date : 18:11 2022/7/4
|
||||
func parseLexical(jsonData string) ([]lexicalNode, error) {
|
||||
jsonData = strings.ReplaceAll(strings.ReplaceAll(jsonData, "\n", ""), "\t", "")
|
||||
if len(jsonData) < 2 {
|
||||
return nil, errors.New("input data is not json")
|
||||
}
|
||||
@ -48,8 +50,7 @@ func parseLexical(jsonData string) ([]lexicalNode, error) {
|
||||
tmpStr = tmpStr + currentChar
|
||||
}
|
||||
}
|
||||
byteData, _ := json.Marshal(lexicalList)
|
||||
fmt.Println("============ : ", string(byteData))
|
||||
util.JSON.ConsoleOutput(lexicalList)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user