Formerly KrillinAI, VideoTranslation and Dubbing Tool for 120+ Languages. Open-source AI workspace for creators, powered by Codex. Video downloader, video translation, create videos, images, audios, and edits with Agents in one place. For your Social Media like YouTube, TikTok, Instagram, etc.
TypeScript agent-skillscodex-clideskop-appdubbingimage-generationlocalizationskillsttsvideo-editingvideo-generationvideo-transcriptionvideo-translation
test(util): cover the space cutset and a string ending in a backslash
askalfd9cafabcc755
diff --git a/runtime/krillinai/pkg/util/json_test.go b/runtime/krillinai/pkg/util/json_test.goindex bb533532..8d7b77c0 100644--- a/runtime/krillinai/pkg/util/json_test.go+++ b/runtime/krillinai/pkg/util/json_test.go@@ -23,13 +23,13 @@ func TestExtractJSONObject(t *testing.T) {},{name: "object trailing comma",- response: "{\n\"short_sentences\":[{\n\"text\": \"the owl is a symbol\",\n}] \n}",+ response: "{\n\"short_sentences\":[{\n\"text\": \"the owl is a symbol\",\n\t}] \n}",key: "short_sentences",want: "{\n\"short_sentences\":[{\n\"text\": \"the owl is a symbol\"}] \n}",},{name: "array trailing comma",- response: `{"short_sentences":[{"text":"a"},{"text":"b"},]}`,+ response: `{"short_sentences":[{"text":"a"},{"text":"b"}, ]}`,key: "short_sentences",want: `{"short_sentences":[{"text":"a"},{"text":"b"}]}`,},@@ -94,10 +94,10 @@ func TestExtractJSONObject(t *testing.T) {want: `{"align":[{"origin_part":"a"}]}`,},{- name: "escaped quote",- response: `{"text":"he said \"} \" and left",}`,+ name: "escapes in string",+ response: `{"text":"he said \"} \" then \\",}`,key: "text",- want: `{"text":"he said \"} \" and left"}`,+ want: `{"text":"he said \"} \" then \\"}`,},{name: "comma in string",