Skip to content

Commit

Permalink
@timotimo suggested better way for username generation
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-o committed Oct 6, 2014
1 parent bbdc565 commit e329974
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mysql_test.pl6
Expand Up @@ -19,7 +19,7 @@ $orm.connect(

my $username = '';

$username ~= chr((65 .. 90).pick) for 0 .. 10;
$username = [~] ("a".."z").roll(10);

$username.say;
my $newrow = $orm.create('nickl');
Expand Down
2 changes: 1 addition & 1 deletion pgsql_test.pl6
Expand Up @@ -19,7 +19,7 @@ $orm.connect(

my $username = '';

$username ~= chr((65 .. 90).pick) for 0 .. 10;
$username = [~] ("a".."z").roll(10);

$username.say;
my $newrow = $orm.create('nickl');
Expand Down
2 changes: 1 addition & 1 deletion sqlite.test.pl6
Expand Up @@ -15,7 +15,7 @@ $orm.connect(

my $username = '';

$username ~= chr((65 .. 90).pick) for 0 .. 10;
$username = [~] ("a".."z").roll(10);

$username.say;
my $newrow = $orm.create('nickl');
Expand Down
5 changes: 2 additions & 3 deletions t/01_sqlite.t
Expand Up @@ -17,7 +17,7 @@ $orm.connect(

my $username = '';

$username ~= chr((65 .. 90).pick) for 0 .. 10;
$username = [~] ("a".."z").roll(10);

my $newrow = $orm.create('nickl');

Expand Down Expand Up @@ -60,8 +60,7 @@ ok @($orm.search('nickl', { '-and' => [ 'username' => $username, joined => ('-gt

my @names;
for 0 .. 10 {
$username = '';
$username ~= chr((65 .. 90).pick) for 0 .. 10;
$username = [~] ("a".."z").roll(10);
@names.push($username);
my $row = $orm.create('nickl');
$row.set({username => $username});
Expand Down

0 comments on commit e329974

Please sign in to comment.