Skip to content

Commit

Permalink
some simple cleanup in the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevan Little committed Apr 24, 2013
1 parent 0b1febb commit dccf0a1
Show file tree
Hide file tree
Showing 22 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion t/099-problems/01.t
Expand Up @@ -6,4 +6,4 @@ my @list = [1, 1, 2, 3, 5, 8];

is(@list[-1], 8, "... P01");

done_testing(1);
done_testing();
2 changes: 1 addition & 1 deletion t/099-problems/02.t
Expand Up @@ -6,4 +6,4 @@ my @list = [1, 1, 2, 3, 5, 8];

is(@list[-2], 5, "... P02");

done_testing(1);
done_testing();
6 changes: 3 additions & 3 deletions t/099-problems/03.t
Expand Up @@ -3,13 +3,13 @@

# Example:

# moe> nth(2, [1, 1, 2, 3, 5, 8)]
# moe> nth(2, [1, 1, 2, 3, 5, 8])
# 2

use Test::More;

sub nth($n, @list) { @list[$n] }

is (nth(2, [1, 1, 2, 3, 5, 8], 2, "... P03");
is(nth(2, [1, 1, 2, 3, 5, 8]), 2, "... P03");

done_testing(1);
done_testing();
2 changes: 1 addition & 1 deletion t/099-problems/04.t
Expand Up @@ -6,5 +6,5 @@ my @list = [1, 1, 2, 3, 5, 8];

is (@list.length, 6, "... P04");

done_testing(1);
done_testing();

2 changes: 1 addition & 1 deletion t/099-problems/05.t
Expand Up @@ -6,5 +6,5 @@ my @list = [1, 1, 2, 3, 5, 8];

is_deeply(@list.reverse, [8, 5, 3, 2, 1, 1], "... P05");

done_testing(1);
done_testing();

4 changes: 2 additions & 2 deletions t/099-problems/06.t
@@ -1,7 +1,7 @@
# P06 (*) Find out whether a list is a palindrome.
# Example:

# moe> is_palindrome([1, 2, 3, 2, 1)]
# moe> is_palindrome([1, 2, 3, 2, 1])
# true

use Test::More;
Expand All @@ -13,5 +13,5 @@ sub is_palindrome(@list) {
is(is_palindrome([1, 2, 3, 2, 1]), true, "... P06 -- true") ;
is(is_palindrome([1, 2, 3, 4, 5]), false, "... P06 -- false") ;

done_testing(2);
done_testing();

2 changes: 1 addition & 1 deletion t/099-problems/07.t
Expand Up @@ -6,5 +6,5 @@ my @list = [[1, 1], 2, [3, [5, 8]]];

is_deeply(@list.flatten, [1, 1, 2, 3, 5, 8], "... P07");

done_testing(1);
done_testing();

2 changes: 1 addition & 1 deletion t/099-problems/08.t
Expand Up @@ -21,5 +21,5 @@ sub compress(*@list) {

is_deeply(compress('a', 'a', 'a', 'a', 'b', 'c', 'c', 'a', 'a', 'd', 'e', 'e', 'e', 'e'), ['a', 'b', 'c', 'a', 'd', 'e'], "... P08");

done_testing(1);
done_testing();

2 changes: 1 addition & 1 deletion t/099-problems/09.t
Expand Up @@ -25,5 +25,5 @@ is_deeply(pack('a', 'a', 'a', 'a', 'b', 'c', 'c', 'a', 'a', 'd', 'e', 'e', 'e',
[['a', 'a', 'a', 'a'], ['b'], ['c', 'c'], ['a', 'a'], ['d'], ['e', 'e', 'e', 'e']],
"... P09");

done_testing(1);
done_testing();

2 changes: 1 addition & 1 deletion t/099-problems/10.t
Expand Up @@ -31,5 +31,5 @@ is_deeply(encode("a", "a", "a", "a", "b", "c", "c", "a", "a", "d", "e", "e", "e"
[[4, "a"], [1, "b"], [2, "c"], [2, "a"], [1, "d"], [4, "e"]],
"... P10");

done_testing(1);
done_testing();

2 changes: 1 addition & 1 deletion t/099-problems/11.t
Expand Up @@ -29,5 +29,5 @@ is_deeply(encodeModified('a', 'a', 'a', 'a', 'b', 'c', 'c', 'a', 'a', 'd', 'e',
[[4, "a"], "b", [2, "c"], [2, "a"], "d", [4, "e"]],
"... P11");

done_testing(1);
done_testing();

2 changes: 1 addition & 1 deletion t/099-problems/12.t
Expand Up @@ -17,5 +17,5 @@ is_deeply(decode([[4, "a"], [1, "b"], [2, "c"], [2, "a"], [1, "d"], [4, "e"]]),
["a", "a", "a", "a", "b", "c", "c", "a", "a", "d", "e", "e", "e", "e"],
"... P12");

done_testing(1);
done_testing();

2 changes: 1 addition & 1 deletion t/099-problems/13.t
Expand Up @@ -27,5 +27,5 @@ is_deeply(encodeDirect("a", "a", "a", "a", "b", "c", "c", "a", "a", "d", "e", "e
[[4, "a"], [1, "b"], [2, "c"], [2, "a"], [1, "d"], [4, "e"]],
"... P13");

done_testing(1);
done_testing();

2 changes: 1 addition & 1 deletion t/099-problems/14.t
Expand Up @@ -14,5 +14,5 @@ is_deeply(duplicate(["a", "b", "c", "c", "d"]),
["a", "a", "b", "b", "c", "c", "c", "c", "d", "d"],
"... P14");

done_testing(1);
done_testing();

2 changes: 1 addition & 1 deletion t/099-problems/15.t
Expand Up @@ -14,5 +14,5 @@ is_deeply(duplicateN(3, ["a", "b", "c", "c", "d"]),
["a", "a", "a", "b", "b", "b", "c", "c", "c", "c", "c", "c", "d", "d", "d"],
"... P15");

done_testing(1);
done_testing();

2 changes: 1 addition & 1 deletion t/099-problems/16.t
Expand Up @@ -18,5 +18,5 @@ is_deeply(drop(3, ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k"]),
["a", "b", "d", "e", "g", "h", "j", "k"],
"... P16");

done_testing(1);
done_testing();

2 changes: 1 addition & 1 deletion t/099-problems/17.t
Expand Up @@ -17,5 +17,5 @@ is_deeply(split_list(3, ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k"])
[["a", "b", "c"], ["d", "e", "f", "g", "h", "i", "j", "k"]],
"... P17");

done_testing(1);
done_testing();

2 changes: 1 addition & 1 deletion t/099-problems/18.t
Expand Up @@ -20,5 +20,5 @@ is_deeply(slice_list(3, 7, ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k
["d", "e", "f", "g"],
"... P18");

done_testing(1);
done_testing();

2 changes: 1 addition & 1 deletion t/099-problems/19.t
Expand Up @@ -24,5 +24,5 @@ is_deeply(rotate(-2, ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k"]),
["j", "k", "a", "b", "c", "d", "e", "f", "g", "h", "i"],
"... P19 -- negative arg");

done_testing(2);
done_testing();

2 changes: 1 addition & 1 deletion t/099-problems/20.t
Expand Up @@ -17,5 +17,5 @@ sub remove_at($i, @list) {

is_deeply(remove_at(1, ['a', 'b', 'c', 'd']), [['a', 'c', 'd'], 'b'], "... P20");

done_testing(1);
done_testing();

2 changes: 1 addition & 1 deletion t/099-problems/21.t
Expand Up @@ -16,5 +16,5 @@ sub insert_at($new, $at, @list) {

is_deeply(insert_at('new', 1, ['a', 'b', 'c', 'd']), ['a', 'new', 'b', 'c', 'd'], "... P21");

done_testing(1);
done_testing();

2 changes: 1 addition & 1 deletion t/099-problems/22.t
Expand Up @@ -10,5 +10,5 @@ sub range($start, $end) { $start .. $end }

is_deeply(range(4, 9), [4, 5, 6, 7, 8, 9], "... P22");

done_testing(1);
done_testing();

0 comments on commit dccf0a1

Please sign in to comment.