Permalink
Browse files

[t/spec] Moved string tests under S29-str

git-svn-id: http://svn.pugscode.org/pugs@20237 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent bb281e2 commit 6794d4bcd1b37c2cd86db1e7ab0547c7e1cc28e5 cosimo committed Apr 5, 2008
Showing with 29 additions and 0 deletions.
  1. +29 −0 S29-str/append.t
View
29 S29-str/append.t
@@ -0,0 +1,29 @@
+use v6-alpha;
+
+use Test;
+
+=begin description
+
+String appending with ~ operator
+L<S03/Changes to Perl 5 operators/string concatenation becomes stitching>
+
+=end description
+
+plan 4;
+
+# Again, mostly stolen from Perl 5
+
+my $a = 'ab' ~ 'c';
+is($a, 'abc', '~ two literals correctly');
+
+my $b = 'def';
+
+my $c = $a ~ $b;
+is($c, 'abcdef', '~ two variables correctly');
+
+$c ~= "xyz";
+is($c, 'abcdefxyz', '~= a literal string correctly');
+
+my $d = $a;
+$d ~= $b;
+is($d, 'abcdef', '~= variable correctly');

0 comments on commit 6794d4b

Please sign in to comment.