use Test;

plan 4;

my @unis = eager [eager Uni.new((800..850).pick(5)) xx 1000] xx 4;
my @promises = do for ^4 -> $t {
    start .Str for @unis[$t];
}
await @promises;

is @promises[0].result.elems, 1000, 'Thread 1 made strings successfully';
is @promises[1].result.elems, 1000, 'Thread 2 made strings successfully';
is @promises[2].result.elems, 1000, 'Thread 3 made strings successfully';
is @promises[3].result.elems, 1000, 'Thread 4 made strings successfully';

Add tests covering Uni => NFG over many threads.
Add tests covering Uni => NFG over many threads.

This tests thread safety of the graphemes table. There's an NYI in
MoarVM at the moment that causes this test to panic; once that's
fixed, this test can be added to spectest.data and will ensure we
don't regress in this area.
