Aion

 view release on metacpan or  search on metacpan

lib/Aion/Types.md  view on Meta::CPAN

Strings, include numbers.

```perl
1.1 ~~ Str         # -> 1
"" ~~ Str          # -> 1
1.1.0 ~~ Str       # -> ""
```

## Uni

Unicode strings: with utf8-flag or decode to utf8 without error.

```perl
"↭" ~~ Uni    # -> 1
123 ~~ Uni    # -> ""
do {no utf8; "↭" ~~ Uni}    # -> 1
```

## Bin

Binary strings: without utf8-flag and octets with numbers less then 128.

```perl
123 ~~ Bin    # -> 1
"z" ~~ Bin    # -> 1
"↭" ~~ Bin    # -> ""
do {no utf8; "↭" ~~ Bin }   # -> ""
```

## StartsWith\[S]

lib/Aion/Types.pm  view on Meta::CPAN

=head2 Str

Strings, include numbers.

	1.1 ~~ Str         # -> 1
	"" ~~ Str          # -> 1
	1.1.0 ~~ Str       # -> ""

=head2 Uni

Unicode strings: with utf8-flag or decode to utf8 without error.

	"↭" ~~ Uni    # -> 1
	123 ~~ Uni    # -> ""
	do {no utf8; "↭" ~~ Uni}    # -> 1

=head2 Bin

Binary strings: without utf8-flag and octets with numbers less then 128.

	123 ~~ Bin    # -> 1
	"z" ~~ Bin    # -> 1
	"↭" ~~ Bin    # -> ""
	do {no utf8; "↭" ~~ Bin }   # -> ""

=head2 StartsWith[S]

The string starts with C<S>.

t/aion/types.t  view on Meta::CPAN

# Strings, include numbers.
# 
done_testing; }; subtest 'Str' => sub { 
::is scalar do {1.1 ~~ Str}, scalar do{1}, '1.1 ~~ Str         # -> 1';
::is scalar do {"" ~~ Str}, scalar do{1}, '"" ~~ Str          # -> 1';
::is scalar do {1.1.0 ~~ Str}, scalar do{""}, '1.1.0 ~~ Str       # -> ""';

# 
# ## Uni
# 
# Unicode strings: with utf8-flag or decode to utf8 without error.
# 
done_testing; }; subtest 'Uni' => sub { 
::is scalar do {"↭" ~~ Uni}, scalar do{1}, '"↭" ~~ Uni    # -> 1';
::is scalar do {123 ~~ Uni}, scalar do{""}, '123 ~~ Uni    # -> ""';
::is scalar do {do {no utf8; "↭" ~~ Uni}}, scalar do{1}, 'do {no utf8; "↭" ~~ Uni}    # -> 1';

# 
# ## Bin
# 
# Binary strings: without utf8-flag and octets with numbers less then 128.
# 
done_testing; }; subtest 'Bin' => sub { 
::is scalar do {123 ~~ Bin}, scalar do{1}, '123 ~~ Bin    # -> 1';
::is scalar do {"z" ~~ Bin}, scalar do{1}, '"z" ~~ Bin    # -> 1';
::is scalar do {"↭" ~~ Bin}, scalar do{""}, '"↭" ~~ Bin    # -> ""';
::is scalar do {do {no utf8; "↭" ~~ Bin }}, scalar do{""}, 'do {no utf8; "↭" ~~ Bin }   # -> ""';

# 
# ## StartsWith\[S]
# 



( run in 1.499 second using v1.01-cache-2.11-cpan-94b05bcf43c )