Skip to content

Commit

Permalink
Fix some copy-pastos in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Nov 19, 2020
1 parent 1d79e5c commit b292749
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
32 changes: 16 additions & 16 deletions S09-typed-arrays/native-shape1-num.t
Expand Up @@ -8,7 +8,7 @@ if $*KERNEL.bits == 64 {

plan @num * 111;

# Basic native int array tests.
# Basic native num array tests.
for @num -> $T {
my $t = $T.^name;
diag "Testing $t array";
Expand Down Expand Up @@ -93,17 +93,17 @@ for @num -> $T {
is @arr[3], 34e0, "Mutating map on $t array works (4)";

is @arr.grep(* < 30).elems, 2, "grep a $t array";
is-deeply @arr.grep(34), (34e0,), "$t array.grep(Int)";
is-deeply @arr.grep(34, :k), (3,), "$t array.grep(Int, :k)";
is-deeply @arr.grep(34, :kv), (3,34e0), "$t array.grep(Int, :kv)";
is-deeply @arr.grep(34, :p), (Pair.new(3,34e0),), "$t array.grep(Int, :p)";
is-deeply @arr.grep(34, :v), (34e0,), "$t array.grep(Int, :v)";

is-deeply @arr.first(34), 34e0, "$t array.grep(Int)";
is-deeply @arr.first(34, :k), 3, "$t array.grep(Int, :k)";
is-deeply @arr.first(34, :kv), (3,34e0), "$t array.grep(Int, :kv)";
is-deeply @arr.first(34, :p), Pair.new(3,34e0), "$t array.grep(Int, :p)";
is-deeply @arr.first(34, :v), 34e0, "$t array.grep(Int, :v)";
is-deeply @arr.grep(34), (34e0,), "$t array.grep(Num)";
is-deeply @arr.grep(34, :k), (3,), "$t array.grep(Num, :k)";
is-deeply @arr.grep(34, :kv), (3,34e0), "$t array.grep(Num, :kv)";
is-deeply @arr.grep(34, :p), (Pair.new(3,34e0),), "$t array.grep(Num, :p)";
is-deeply @arr.grep(34, :v), (34e0,), "$t array.grep(Num, :v)";

is-deeply @arr.first(34), 34e0, "$t array.grep(Num)";
is-deeply @arr.first(34, :k), 3, "$t array.grep(Num, :k)";
is-deeply @arr.first(34, :kv), (3,34e0), "$t array.grep(Num, :kv)";
is-deeply @arr.first(34, :p), Pair.new(3,34e0), "$t array.grep(Num, :p)";
is-deeply @arr.first(34, :v), 34e0, "$t array.grep(Num, :v)";

is ([+] @arr), 114e0, "Can use reduce meta-op on a $t array";

Expand Down Expand Up @@ -151,7 +151,7 @@ for @num -> $T {
#?rakudo todo 'STORE not working correctly yet)'
is @arr.join(":"), "42:666:0:0", "does re-initializing a $t array work";

# Interaction of native shaped int arrays and untyped arrays.
# Interaction of native shaped num arrays and untyped arrays.
my @native := array[$T].new(:shape(10),1e0..10e0);
my @untyped = @native;
is @untyped.elems, 10, "List-assigning $t array to untyped works (1)";
Expand All @@ -168,9 +168,9 @@ for @num -> $T {
my @untyped2 = 21e0..30e0;
my @native2 := array[$T].new(:shape(10));
@native2 = @untyped2;
is @native2.elems, 10, "List-assign untyped array of Int to $t array (1)";
is @native2[0], 21e0, "List-assign untyped array of Int to $t array (2)";
is @native2[9], 30e0, "List-assign untyped array of Int to $t array (3)";
is @native2.elems, 10, "List-assign untyped array of Num to $t array (1)";
is @native2[0], 21e0, "List-assign untyped array of Num to $t array (2)";
is @native2[9], 30e0, "List-assign untyped array of Num to $t array (3)";

@untyped2[9] = 'C-C-C-C-Combo Breaker!';
throws-like { @native2 = @untyped2 }, Exception,
Expand Down
30 changes: 15 additions & 15 deletions S09-typed-arrays/native-shape1-str.t
Expand Up @@ -87,17 +87,17 @@ is @arr[2], "bb", "Mutating map on $t array works (3)";
is @arr[3], "uu", "Mutating map on $t array works (4)";

is @arr.grep(* le "ff").elems, 2, "grep a $t array";
is-deeply @arr.grep("uu"), ("uu",), "$t array.grep(Int)";
is-deeply @arr.grep("uu", :k), (3,), "$t array.grep(Int, :k)";
is-deeply @arr.grep("uu", :kv), (3,"uu"), "$t array.grep(Int, :kv)";
is-deeply @arr.grep("uu", :p), (Pair.new(3,"uu"),), "$t array.grep(Int, :p)";
is-deeply @arr.grep("uu", :v), ("uu",), "$t array.grep(Int, :v)";

is-deeply @arr.first("uu"), "uu", "$t array.grep(Int)";
is-deeply @arr.first("uu", :k), 3, "$t array.grep(Int, :k)";
is-deeply @arr.first("uu", :kv), (3,"uu"), "$t array.grep(Int, :kv)";
is-deeply @arr.first("uu", :p), Pair.new(3,"uu"), "$t array.grep(Int, :p)";
is-deeply @arr.first("uu", :v), "uu", "$t array.grep(Int, :v)";
is-deeply @arr.grep("uu"), ("uu",), "$t array.grep(Str)";
is-deeply @arr.grep("uu", :k), (3,), "$t array.grep(Str, :k)";
is-deeply @arr.grep("uu", :kv), (3,"uu"), "$t array.grep(Str, :kv)";
is-deeply @arr.grep("uu", :p), (Pair.new(3,"uu"),), "$t array.grep(Str, :p)";
is-deeply @arr.grep("uu", :v), ("uu",), "$t array.grep(Str, :v)";

is-deeply @arr.first("uu"), "uu", "$t array.grep(Str)";
is-deeply @arr.first("uu", :k), 3, "$t array.grep(Str, :k)";
is-deeply @arr.first("uu", :kv), (3,"uu"), "$t array.grep(Str, :kv)";
is-deeply @arr.first("uu", :p), Pair.new(3,"uu"), "$t array.grep(Str, :p)";
is-deeply @arr.first("uu", :v), "uu", "$t array.grep(Str, :v)";

is ([~] @arr), "nnffbbuu", "Can use reduce meta-op on a $t array";

Expand Down Expand Up @@ -145,7 +145,7 @@ is @arr.join(":"), ":::", "does emptying a $t array reset";
#?rakudo todo 'STORE not working correctly yet)'
is @arr.join(":"), "a:b::", "does re-initializing a $t array work";

# Interaction of native shaped int arrays and untyped arrays.
# Interaction of native shaped str arrays and untyped arrays.
my @native := array[$T].new(:shape(10),"a".."j");
my @untyped = @native;
is @untyped.elems, 10, "List-assigning $t array to untyped works (1)";
Expand All @@ -162,9 +162,9 @@ is @untyped[11], "z", "List-assign $t array surrounded by literals (5)";
my @untyped2 = "g".."p";
my @native2 := array[$T].new(:shape(10));
@native2 = @untyped2;
is @native2.elems, 10, "List-assign untyped array of Int to $t array (1)";
is @native2[0], "g", "List-assign untyped array of Int to $t array (2)";
is @native2[9], "p", "List-assign untyped array of Int to $t array (3)";
is @native2.elems, 10, "List-assign untyped array of Str to $t array (1)";
is @native2[0], "g", "List-assign untyped array of Str to $t array (2)";
is @native2[9], "p", "List-assign untyped array of Str to $t array (3)";

@untyped2[9] = 666;
throws-like { @native2 = @untyped2 }, Exception,
Expand Down

0 comments on commit b292749

Please sign in to comment.