Changeset 3067
- Timestamp:
- 05/12/05 13:34:59 (4 years ago)
- svk:copy_cache_prev:
- 4536
- Files:
-
- 2 modified
-
src/Pugs/Prim/List.hs (modified) (1 diff)
-
t/builtins/lists/join.t (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Prim/List.hs
r3066 r3067 90 90 91 91 op2Join :: Val -> Val -> Eval Val 92 op2Join (VList [x@(VRef _)]) y = op2Join x y 92 93 op2Join x y = do 93 94 (strVal, listVal) <- ifValTypeIsa x "Scalar" -
t/builtins/lists/join.t
r2367 r3067 21 21 22 22 my $joined4 = join("|", [ "a", "b", "c" ]); 23 is($joined4, "a |b|c", 'join("|", []) works');23 is($joined4, "a b c", 'join("|", []) should not join anything'); 24 24 25 25 # join() with $sep as a variable … … 38 38 39 39 my $joined4a = join($sep, [ "a", "b", "c" ]); 40 is($joined4a, "a , b,c", 'join($sep, []) works');40 is($joined4a, "a b c", 'join($sep, []) works'); 41 41 42 42 # join ... without parens … … 55 55 56 56 my $joined4b = join $sep, [ "a", "b", "c" ]; 57 is($joined4b, "a , b, c", 'join $sep, [] works');57 is($joined4b, "a b c", 'join $sep, [] should not join anything'); 58 58 59 59 my $joined4c = join ":", [ "a", "b", "c" ]; 60 is($joined4c, "a :b:c", 'join ":", [] works');60 is($joined4c, "a b c", 'join ":", [] should not join anything'); 61 61 62 62 # join() with empty string as seperator … … 75 75 76 76 my $joined4d = join("", [ "a", "b", "c" ]); 77 is($joined4d, "a bc", 'join("", []) works');77 is($joined4d, "a b c", 'join("", []) works'); 78 78 79 79 # some odd edge cases
