#!perl
use strict; use warnings;
my $test_case_num = 0;
foreach my $operand1 (0..8) {
foreach my $operand2 (0..8) {
foreach my $operation ("+", "-", "/", "*") {
my $expected_result;
eval('$expected_result = $operand1 ' . $operation . '$operand2');
$expected_result = "ERROR $@" if $@;
$test_case_num++;
my $testcase = <<EOL;
Тесткейс: $test_case_num
1. Откройте приложение Калькулятор
2. В поле Операнд1 введите число: $operand1
3. Нажмите на кнопку "$operation"
4. В поле Операнд2 введите число: $operand2
5. Нажмите на кнопку "="
6. Ожидаемые результат операции должен быть: "$expected_result"
EOL
$testcase =~ s/^\s+//gm;
print $testcase, "\n===========\n";
}
}
}