-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from schwern/no-encoding
Choose a utf-8 encoding that will not break threads.
- Loading branch information
Showing
5 changed files
with
71 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!perl | ||
|
||
# Test that utf8::all is choosing the right encoding to not | ||
# tickle thread bugs. | ||
|
||
use strict; | ||
use warnings; | ||
|
||
# This is loaded before threads. It will not be aware of tests run in | ||
# a thread. | ||
use Test::More 0.96; | ||
use Config; | ||
|
||
BEGIN { | ||
plan skip_all => "Requires threads" | ||
if !$Config{usethreads}; | ||
} | ||
|
||
# Deliberately before loading threads so we don't cheat and check | ||
# if threads are loaded, that would be brittle. | ||
use utf8::all; | ||
|
||
use threads; | ||
use threads::shared; | ||
|
||
note "basic utf8 + threads bug"; { | ||
my $ok :shared = 0; | ||
my $t = threads->create(sub { $ok = 1; }); | ||
$t->join(); | ||
ok $ok, "threads ok with utf8::all"; | ||
} | ||
|
||
done_testing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters