From faf6a608210b421de3ec525c8777652ff73f285c Mon Sep 17 00:00:00 2001 From: fly6516 Date: Fri, 16 May 2025 04:04:21 +0800 Subject: [PATCH] =?UTF-8?q?refactor(app):=20=E9=87=8D=E6=9E=84=20AI?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E6=B5=8B=E8=AF=95=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加静态测试数据,用于 AIProblemEditor 组件的测试 - 展示测试用例代码,便于观察和调试 - 为 AIProblemEditor 组件添加初始代码和问题 ID 属性 --- src/app/(app)/test/page.tsx | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/app/(app)/test/page.tsx b/src/app/(app)/test/page.tsx index b8087a4..3ecf074 100644 --- a/src/app/(app)/test/page.tsx +++ b/src/app/(app)/test/page.tsx @@ -1,10 +1,39 @@ import { AIProblemEditor } from '@/components/ai-optimized-editor'; export default function TestAiEditorPage() { + // 静态测试数据 + const testInput = { + code: `function bubbleSort(arr: number[]) { + const n = arr.length; + for (let i = 0; i < n-1; i++) { + for (let j = 0; j < n-i-1; j++) { + if (arr[j] > arr[j+1]) { + [arr[j], arr[j+1]] = [arr[j+1], arr[j]]; + } + } + } + return arr; +}`, + problemId: '1', + }; + return (

AI 编辑器测试页

- + + {/* 测试用例展示 */} +
+

测试用例

+
+                    {testInput.code}
+                
+
+ + {/* 测试组件 */} +
); } \ No newline at end of file