-
Notifications
You must be signed in to change notification settings - Fork 557
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add valid_identifier_{pvn,sv} API functions
- Loading branch information
Showing
9 changed files
with
142 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ use strict; | |
use warnings; | ||
use Carp; | ||
|
||
our $VERSION = '1.39'; | ||
our $VERSION = '1.40'; | ||
|
||
require XSLoader; | ||
|
||
|
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 | ||
|
||
use strict; | ||
use warnings; | ||
|
||
use open ':std', ':encoding(UTF-8)'; | ||
use Test::More; | ||
|
||
use_ok('XS::APItest'); | ||
|
||
# These should all be valid | ||
foreach my $id (qw( abc ab_cd _abc x123 )) { | ||
ok(valid_identifier($id), "'$id' is valid identifier"); | ||
} | ||
|
||
# These should all not be | ||
foreach my $id (qw( ab-cd 123 abc() ), "ab cd") { | ||
ok(!valid_identifier($id), "'$id' is not valid identifier"); | ||
} | ||
|
||
# Now for some UTF-8 tests | ||
{ | ||
use utf8; | ||
|
||
foreach my $id (qw( café sandviĉon )) { | ||
ok(valid_identifier($id), "'$id' is valid UTF-8 identifier"); | ||
} | ||
|
||
# en-dash | ||
ok(!valid_identifier("ab–cd"), "'ab–cd' is not valid UTF-8 identifier"); | ||
} | ||
|
||
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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