From 9ff736e11c20187ff520ed980a4575e459d51580 Mon Sep 17 00:00:00 2001 From: MH Hung Date: Fri, 12 Sep 2025 09:56:37 +0800 Subject: [PATCH] feat(utils,templates,docs): file-based .tmpl templates; remove I/O fixtures --- README.md | 2 -- problems/0042-answer-to-everything/test/input1.txt | 2 -- problems/0042-answer-to-everything/test/input2.txt | 2 -- problems/0042-answer-to-everything/test/output1.txt | 2 -- problems/0042-answer-to-everything/test/output2.txt | 2 -- templates/problem/test/input1.txt.tmpl | 2 -- templates/problem/test/input2.txt.tmpl | 2 -- templates/problem/test/output1.txt.tmpl | 2 -- templates/problem/test/output2.txt.tmpl | 2 -- utils/leetcode_helper.sh | 9 --------- 10 files changed, 27 deletions(-) delete mode 100644 problems/0042-answer-to-everything/test/input1.txt delete mode 100644 problems/0042-answer-to-everything/test/input2.txt delete mode 100644 problems/0042-answer-to-everything/test/output1.txt delete mode 100644 problems/0042-answer-to-everything/test/output2.txt delete mode 100644 templates/problem/test/input1.txt.tmpl delete mode 100644 templates/problem/test/input2.txt.tmpl delete mode 100644 templates/problem/test/output1.txt.tmpl delete mode 100644 templates/problem/test/output2.txt.tmpl diff --git a/README.md b/README.md index 38351fc..14c6766 100755 --- a/README.md +++ b/README.md @@ -62,8 +62,6 @@ problems/NNNN-name/ ├── SolutionTests.cs # xUnit 測試 ├── TestProject.csproj ├── main_test.go # Go testing - ├── input1.txt / output1.txt - ├── input2.txt / output2.txt ├── edge_cases.md └── run_tests.sh # 一鍵執行 C# 與 Go 測試 ``` diff --git a/problems/0042-answer-to-everything/test/input1.txt b/problems/0042-answer-to-everything/test/input1.txt deleted file mode 100644 index d066371..0000000 --- a/problems/0042-answer-to-everything/test/input1.txt +++ /dev/null @@ -1,2 +0,0 @@ -# 測試案例 1 輸入(42 Answer To Everything) - diff --git a/problems/0042-answer-to-everything/test/input2.txt b/problems/0042-answer-to-everything/test/input2.txt deleted file mode 100644 index bae9ccc..0000000 --- a/problems/0042-answer-to-everything/test/input2.txt +++ /dev/null @@ -1,2 +0,0 @@ -# 測試案例 2 輸入(42 Answer To Everything) - diff --git a/problems/0042-answer-to-everything/test/output1.txt b/problems/0042-answer-to-everything/test/output1.txt deleted file mode 100644 index 9f6ae41..0000000 --- a/problems/0042-answer-to-everything/test/output1.txt +++ /dev/null @@ -1,2 +0,0 @@ -# 測試案例 1 期望輸出(42 Answer To Everything) - diff --git a/problems/0042-answer-to-everything/test/output2.txt b/problems/0042-answer-to-everything/test/output2.txt deleted file mode 100644 index 65d613a..0000000 --- a/problems/0042-answer-to-everything/test/output2.txt +++ /dev/null @@ -1,2 +0,0 @@ -# 測試案例 2 期望輸出(42 Answer To Everything) - diff --git a/templates/problem/test/input1.txt.tmpl b/templates/problem/test/input1.txt.tmpl deleted file mode 100644 index 8376e10..0000000 --- a/templates/problem/test/input1.txt.tmpl +++ /dev/null @@ -1,2 +0,0 @@ -# 測試案例 1 輸入({{NUMBER}} {{NAME_TITLE}}) - diff --git a/templates/problem/test/input2.txt.tmpl b/templates/problem/test/input2.txt.tmpl deleted file mode 100644 index fd143c2..0000000 --- a/templates/problem/test/input2.txt.tmpl +++ /dev/null @@ -1,2 +0,0 @@ -# 測試案例 2 輸入({{NUMBER}} {{NAME_TITLE}}) - diff --git a/templates/problem/test/output1.txt.tmpl b/templates/problem/test/output1.txt.tmpl deleted file mode 100644 index 8fe77b2..0000000 --- a/templates/problem/test/output1.txt.tmpl +++ /dev/null @@ -1,2 +0,0 @@ -# 測試案例 1 期望輸出({{NUMBER}} {{NAME_TITLE}}) - diff --git a/templates/problem/test/output2.txt.tmpl b/templates/problem/test/output2.txt.tmpl deleted file mode 100644 index 9b4b34f..0000000 --- a/templates/problem/test/output2.txt.tmpl +++ /dev/null @@ -1,2 +0,0 @@ -# 測試案例 2 期望輸出({{NUMBER}} {{NAME_TITLE}}) - diff --git a/utils/leetcode_helper.sh b/utils/leetcode_helper.sh index ac4c94d..2d5eeef 100755 --- a/utils/leetcode_helper.sh +++ b/utils/leetcode_helper.sh @@ -71,15 +71,6 @@ create_test_files() { "$problem_dir/test/edge_cases.md" \ "$number" "$number_pad" "$name_slug" "$name_title" "$difficulty" "$today" "$year_month" - render_template "$TEMPLATES_DIR/problem/test/input1.txt.tmpl" "$problem_dir/test/input1.txt" \ - "$number" "$number_pad" "$name_slug" "$name_title" "$difficulty" "$today" "$year_month" - render_template "$TEMPLATES_DIR/problem/test/output1.txt.tmpl" "$problem_dir/test/output1.txt" \ - "$number" "$number_pad" "$name_slug" "$name_title" "$difficulty" "$today" "$year_month" - render_template "$TEMPLATES_DIR/problem/test/input2.txt.tmpl" "$problem_dir/test/input2.txt" \ - "$number" "$number_pad" "$name_slug" "$name_title" "$difficulty" "$today" "$year_month" - render_template "$TEMPLATES_DIR/problem/test/output2.txt.tmpl" "$problem_dir/test/output2.txt" \ - "$number" "$number_pad" "$name_slug" "$name_title" "$difficulty" "$today" "$year_month" - render_template "$TEMPLATES_DIR/problem/test/run_tests.sh.tmpl" \ "$problem_dir/test/run_tests.sh" \ "$number" "$number_pad" "$name_slug" "$name_title" "$difficulty" "$today" "$year_month"