From a6ecfb510b0a19dd0e8712d03b871c50aca4f152 Mon Sep 17 00:00:00 2001 From: AZEN-SGG Date: Sat, 21 Dec 2024 21:27:33 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A2=D0=B5=D1=81=D1=82=D0=B8=D1=80=D1=83?= =?UTF-8?q?=D1=8E=20=D1=81=20=D0=B2=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=BD?= =?UTF-8?q?=D1=8B=D0=BC=20=D1=84=D0=B0=D0=B9=D0=BB=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/compile-and-test.yml | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/compile-and-test.yml b/.github/workflows/compile-and-test.yml index bdd7f1b..1580ceb 100644 --- a/.github/workflows/compile-and-test.yml +++ b/.github/workflows/compile-and-test.yml @@ -45,7 +45,6 @@ jobs: exit 1 fi - # Проверяем, что есть папка t/ с тестовыми файлами if [ ! -d "t" ]; then echo "::error::Directory 't' with test files not found" exit 1 @@ -55,19 +54,16 @@ jobs: echo "------------------------------------" echo "Testing with file: $file" - # Способ 1. Передавать через временный файл - # echo "0" > test_input.txt - # echo "$file" >> test_input.txt - # echo "=== Test input ===" - # cat test_input.txt - # echo "==================" - # ./a.out < test_input.txt - - # Способ 2. Через printf (важно экранировать %s и $file) - printf "0\n%s\n" "$file" | ./a.out - # Или можно так (если хотите увидеть ввод на экране лога): - echo -e "0\n$file\n" | ./a.out + # Создаём временный файл с "0" и именем тестового файла: + echo "0" > test_input.txt + echo "$file" >> test_input.txt + echo "==== DEBUG test_input.txt ====" + cat -A test_input.txt + echo "==============================" + + # Теперь фидим это stdin + ./a.out < test_input.txt status=$? echo "Exit code: $status"