Skip to content

Commit 3fce078

Browse files
committed
CI test before release
1 parent 5d77fc6 commit 3fce078

File tree

8 files changed

+139
-62
lines changed

8 files changed

+139
-62
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
.precomp
2-
.idea
1+
.precomp/
2+
/URI-Encode-*
3+
*.rakucov

Changes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Revision history for URI::Encode
22

33
{{$NEXT}}
4+
- Use supported SPDX license info, JRaspass++
5+
- Update copyright year
46

57
0.1 2024-12-02T16:20:19+01:00
68
- Use modern file extensions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ COPYRIGHT AND LICENSE
5252

5353
Copyright 2014 - 2015 David Farrell
5454

55-
Copyright 2016 - 2024 Raku Community
55+
Copyright 2016 - 2025 Raku Community
5656

5757
This library is free software; you can redistribute it and/or modify it under the FreeBSD license.
5858

dist.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = URI::Encode
22

33
[ReadmeFromPod]
4-
filename = lib/URI/Encode.rakumod
4+
filename = doc/URI-Encode.rakudoc
55

66
[UploadToZef]
77

doc/URI-Encode.rakudoc

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
=begin pod
2+
3+
=head1 NAME
4+
5+
URI::Encode - a Raku module for encoding / decoding URIs
6+
7+
=head1 SYNOPSIS
8+
9+
=begin code :lang<raku>
10+
11+
use URI::Encode;
12+
13+
# for encoding whole URIs, ignores reserved chars: :/?#[]@!$&'()*+,;=
14+
my $encoded_uri = uri_encode('http://www.example.com/?name=john doe&age=54');
15+
16+
# encode every reserved char
17+
my $encoded_uri_component = uri_encode_component('some text/to encode+ safely');
18+
19+
# remove percent encoding
20+
my $decoded_uri = uri_decode('http://www.example.com/?name=john%20doe&age=54');
21+
22+
# provided for symmetry, is the same as uri_decode()
23+
my $decoded_component = uri_decode_component('some%20text%2Fto%20%2B%20safely');
24+
25+
=end code
26+
27+
=head1 DESCRIPTION
28+
29+
URI::Encode is a module that exports four subroutines:
30+
31+
=item uri_encode - encode a whole URI
32+
=item uri_encode_component - encode every reserved char
33+
=item uri_decode - decode a whole URI
34+
=item uri_decode_component - decode every reserved char
35+
36+
=head1 SEE ALSo
37+
38+
L<C<URI>|https://raku.land/github:raku-community-modules/URI> is another
39+
implementation that covers this area, including encoding and decoding of
40+
URIs.
41+
42+
=head1 AUTHOR
43+
44+
David Farrell
45+
46+
=head1 COPYRIGHT AND LICENSE
47+
48+
Copyright 2014 - 2015 David Farrell
49+
50+
Copyright 2016 - 2025 Raku Community
51+
52+
This library is free software; you can redistribute it and/or modify it under the FreeBSD license.
53+
54+
=end pod
55+
56+
# vim: expandtab shiftwidth=4

lib/URI/Encode.rakumod

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -47,59 +47,4 @@ sub uri_decode_component (Str:D $text) is export {
4747
$text.subst(/[\%$<bit>=[<[0..9A..Fa..f]>** 2]]+/, &dec, :g)
4848
}
4949

50-
=begin pod
51-
52-
=head1 NAME
53-
54-
URI::Encode - a Raku module for encoding / decoding URIs
55-
56-
=head1 SYNOPSIS
57-
58-
=begin code :lang<raku>
59-
60-
use URI::Encode;
61-
62-
# for encoding whole URIs, ignores reserved chars: :/?#[]@!$&'()*+,;=
63-
my $encoded_uri = uri_encode('http://www.example.com/?name=john doe&age=54');
64-
65-
# encode every reserved char
66-
my $encoded_uri_component = uri_encode_component('some text/to encode+ safely');
67-
68-
# remove percent encoding
69-
my $decoded_uri = uri_decode('http://www.example.com/?name=john%20doe&age=54');
70-
71-
# provided for symmetry, is the same as uri_decode()
72-
my $decoded_component = uri_decode_component('some%20text%2Fto%20%2B%20safely');
73-
74-
=end code
75-
76-
=head1 DESCRIPTION
77-
78-
URI::Encode is a module that exports four subroutines:
79-
80-
=item uri_encode - encode a whole URI
81-
=item uri_encode_component - encode every reserved char
82-
=item uri_decode - decode a whole URI
83-
=item uri_decode_component - decode every reserved char
84-
85-
=head1 SEE ALSo
86-
87-
L<C<URI>|https://raku.land/github:raku-community-modules/URI> is another
88-
implementation that covers this area, including encoding and decoding of
89-
URIs.
90-
91-
=head1 AUTHOR
92-
93-
David Farrell
94-
95-
=head1 COPYRIGHT AND LICENSE
96-
97-
Copyright 2014 - 2015 David Farrell
98-
99-
Copyright 2016 - 2024 Raku Community
100-
101-
This library is free software; you can redistribute it and/or modify it under the FreeBSD license.
102-
103-
=end pod
104-
10550
# vim: expandtab shiftwidth=4

run-tests

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,68 @@
1-
unit sub MAIN(:a($author), :i($install));
1+
unit sub MAIN(
2+
:a($author),
3+
:i($install),
4+
:$rmd,
5+
:$disable-spesh,
6+
:$disable-spesh-inline,
7+
:$disable-JIT,
8+
:$enable-spesh-nodelay,
9+
:$enable-spesh-blocking,
10+
:$enable-spesh-log,
11+
);
212

313
say run(<raku --version>, :out).out.slurp.chomp;
414
say "Running on $*DISTRO.gist().\n";
515

16+
if $rmd {
17+
%*ENV<RAKUDO_MODULE_DEBUG> := 1;
18+
say "RAKUDO_MODULE_DEBUG=1";
19+
}
20+
21+
if $disable-spesh {
22+
%*ENV<MVM_SPESH_DISABLE> := 1;
23+
say "MVM_SPESH_DISABLE=1";
24+
}
25+
26+
if $disable-spesh-inline {
27+
%*ENV<MVM_SPESH_INLINE_DISABLE> := 1;
28+
say "MVM_SPESH_INLINE_DISABLE=1";
29+
}
30+
31+
if $disable-JIT {
32+
%*ENV<MVM_JIT_DISABLE> := 1;
33+
say "MVM_JIT_DISABLE=1";
34+
}
35+
36+
if $enable-spesh-nodelay {
37+
%*ENV<MVM_SPESH_NODELAY> := 1;
38+
say "MVM_SPESH_NODELAY=1";
39+
}
40+
41+
if $enable-spesh-blocking {
42+
%*ENV<MVM_SPESH_BLOCKING> := 1;
43+
say "MVM_SPESH_BLOCKING=1";
44+
}
45+
46+
my $spesh-log;
47+
if $enable-spesh-log {
48+
$spesh-log = (
49+
$enable-spesh-log ~~ Bool ?? "spesh-log" !! $enable-spesh-log
50+
).IO;
51+
%*ENV<MVM_SPESH_LOG> := $spesh-log.absolute;
52+
say "MVM_SPESH_LOG=$spesh-log.relative()";
53+
}
54+
55+
say ""
56+
if $rmd
57+
|| $disable-spesh
58+
|| $disable-spesh-inline
59+
|| $disable-JIT
60+
|| $enable-spesh-nodelay
61+
|| $enable-spesh-blocking
62+
|| $enable-spesh-log;
63+
664
say "Testing {
7-
"dist.ini".IO.lines.head.substr(7)
65+
(try "dist.ini".IO.lines.head.substr(7)) // "..."
866
}{
967
" including author tests" if $author
1068
}";
@@ -15,6 +73,7 @@ my $done = 0;
1573
sub process($proc, $filename) {
1674
if $proc {
1775
$proc.out.slurp;
76+
$spesh-log.unlink if $spesh-log;
1877
}
1978
else {
2079
@failed.push($filename);
@@ -32,6 +91,12 @@ sub process($proc, $filename) {
3291
else {
3392
say "No output received, exit-code $proc.exitcode() ($proc.signal()):\n$proc.os-error()";
3493
}
94+
95+
if $spesh-log {
96+
say "\nSpesh log requested, showing last 20000 lines:";
97+
say $spesh-log.lines(:!chomp).tail(20000).join;
98+
$spesh-log.unlink;
99+
}
35100
}
36101
}
37102

@@ -53,7 +118,10 @@ sub test-dir($dir) {
53118
test-dir("t");
54119
test-dir($_) for dir("t", :test({ !.starts-with(".") && "t/$_".IO.d})).map(*.Str).sort;
55120
test-dir("xt") if $author && "xt".IO.e;
56-
install if $install;
121+
if $install {
122+
install;
123+
++$done;
124+
}
57125

58126
if @failed {
59127
say "\nFAILED: {+@failed} of $done:";

xt/coverage.rakutest

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
use Test::Coverage;
2+
3+
must-be-complete;
4+
5+
# vim: expandtab shiftwidth=4

0 commit comments

Comments
 (0)