generated from emilybache/GildedRose-Refactoring-Kata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
texttest_fixture.p6
executable file
·70 lines (63 loc) · 1.44 KB
/
texttest_fixture.p6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env perl6
use v6;
use lib 'lib';
use GildedRose;
use Item;
print 'OMGHAI!', "\n";
my @items = (
Item.new(
name => '+5 Dexterity Vest',
sell_in => 10,
quality => 20
),
Item.new(
name => 'Aged Brie',
sell_in => 2,
quality => 0
),
Item.new(
name => 'Elixir of the Mongoose',
sell_in => 5,
quality => 7
),
Item.new(
name => 'Sulfuras, Hand of Ragnaros',
sell_in => 0,
quality => 80
),
Item.new(
name => 'Sulfuras, Hand of Ragnaros',
sell_in => -1,
quality => 80
),
Item.new(
name => 'Backstage passes to a TAFKAL80ETC concert',
sell_in => 15,
quality => 20
),
Item.new(
name => 'Backstage passes to a TAFKAL80ETC concert',
sell_in => 10,
quality => 49
),
Item.new(
name => 'Backstage passes to a TAFKAL80ETC concert',
sell_in => 5,
quality => 49
),
Item.new( # This Conjured item does not work properly yet
name => 'Conjured Mana Cake',
sell_in => 3,
quality => 6
),
);
sub MAIN(Int $days = 2) {
my $gilded-rose = GildedRose.new( items => @items );
for ^$days -> $day {
say "-------- day $day --------";
say 'name, sellIn, quality';
.Str.say for $gilded-rose.items;
"".say;
$gilded-rose.update_quality();
}
}