Created
April 24, 2014 12:11
-
-
Save bessarabov/11252419 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings FATAL => 'all'; | |
use utf8; | |
use open qw(:std :utf8); | |
use Test::More; | |
use POSIX; | |
sub main { | |
my $мандариновый = 170; | |
my $минеральная_вода = 161; | |
my $чай_эрл_грей_в = 215; | |
my $чай_эрл_грей_д = 215; | |
my $брускета = 287; | |
my $бургер = 395; | |
my $картофельный_пирог = 323; | |
my $кассата = 224; | |
my $суп_из_сыра = 197; | |
my $наценка = 1.2; | |
my $в = | |
( | |
$чай_эрл_грей_в | |
+ $брускета | |
+ $картофельный_пирог | |
) * $наценка ; | |
; | |
my $д = | |
( | |
$мандариновый | |
+ $минеральная_вода | |
+ $чай_эрл_грей_д | |
+ $бургер | |
+ $кассата | |
+ $суп_из_сыра | |
) * $наценка | |
; | |
my $итого = 2624.40; | |
my $на_чай = 200; | |
is( | |
$в + $д, | |
$итого, | |
'Проверка что сумма соответствует чеку', | |
); | |
diag( "Долг: " . ceil($д - ($на_чай / 2)) ); | |
done_testing(); | |
} | |
main(); | |
__END__ | |
output: | |
ok 1 - Проверка что сумма соответствует чеку | |
# Долг: 1535 | |
1..1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment