Skip to content

Commit ae9fec8

Browse files
committed
Move PWS files into a subdir
1 parent 5d7f12d commit ae9fec8

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ assets/cache
2020
.sass-cache/
2121
links.txt
2222
links.tmp
23-
xt/aspell.pws
23+
xt/pws/aspell.pws
2424
highlights/node_modules
2525
**/npm-debug.log
2626
highlights/atom-language-perl6/
@@ -33,4 +33,4 @@ node_modules/
3333
package-lock.json
3434
*.epub
3535
.idea
36-
*.iml
36+
*.iml

util/clean-spell

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env raku
22

3-
# Remove words in xt/*.pws that are no longer needed
3+
# Remove words in xt/pws/*.pws that are no longer needed
44
# * Bug fixes in the spell checker have removed the need
55
# to check certain words.
66
# * Edits to the docs themselves no longer use some words.
@@ -33,7 +33,7 @@ sub erase-word($file, @words, $word="") {
3333
run('mv', $tmp_fname, $file);
3434
}
3535

36-
for <xt/words.pws xt/code.pws> -> $dict {
36+
for <xt/pws/words.pws xt/pws/code.pws> -> $dict {
3737
my @words = $dict.IO.lines;
3838
for @words -> $word {
3939
note "Testing $dict / $word ";

xt/aspell.t

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ that are only allowed in code (variable names, some output, etc.).
1919
2020
If the test fails, you can make it pass again by changing the
2121
text (fixing the spelling issue), or adding the new word to
22-
C<xt/words.pws> (if it's a word, a class/method name, known
23-
program name, etc.), or to C<xt/code.pws> (if it's a fragment of
22+
C<xt/pws/words.pws> (if it's a word, a class/method name, known
23+
program name, etc.), or to C<xt/pws/code.pws> (if it's a fragment of
2424
text that is part of a code example)
2525
2626
=end overview
@@ -38,9 +38,9 @@ if $proc.exitcode {
3838
# generate a combined words file
3939
# a header is required, but is supplied by words.pws
4040

41-
my $dict = $*PROGRAM.parent.child("aspell.pws").open(:w);
42-
$dict.say($*PROGRAM.parent.child("words.pws").IO.slurp.chomp);
43-
$dict.say($*PROGRAM.parent.child("code.pws").IO.slurp.chomp);
41+
my $dict = $*PROGRAM.parent.child("pws/aspell.pws").open(:w);
42+
$dict.say($*PROGRAM.parent.child("pws/words.pws").IO.slurp.chomp);
43+
$dict.say($*PROGRAM.parent.child("pws/code.pws").IO.slurp.chomp);
4444
$dict.close;
4545

4646
my %output;
@@ -75,10 +75,10 @@ my $lock = Lock.new;
7575
my ($dict, $body);
7676
if $type eq "code" {
7777
$body = $code;
78-
$dict = $*PROGRAM.parent.child("aspell.pws").absolute;
78+
$dict = $*PROGRAM.parent.child("pws/aspell.pws").absolute;
7979
} else {
8080
$body = $text;
81-
$dict = $*PROGRAM.parent.child("words.pws").absolute;
81+
$dict = $*PROGRAM.parent.child("pws/words.pws").absolute;
8282
}
8383

8484
react {
File renamed without changes.
File renamed without changes.

xt/words.t

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@ Avoid duplicates, verify header, lowercase, sorting.
1515

1616
plan 6;
1717

18-
my @words = $*PROGRAM.parent.child('words.pws').IO.lines;
19-
my @code = $*PROGRAM.parent.child('code.pws').IO.lines;
18+
my @words = $*PROGRAM.parent.child('pws/words.pws').IO.lines;
19+
my @code = $*PROGRAM.parent.child('pws/code.pws').IO.lines;
2020

2121
my $header = @words.shift;
2222

23-
is($header, 'personal_ws-1.1 en 0 utf-8', "header on xt/words.pws is correct");
23+
is($header, 'personal_ws-1.1 en 0 utf-8', "header on xt/pws/words.pws is correct");
2424

2525
sub sorted(@lexicon) {
2626
return [&&] @lexicon.rotor(2 => -1).map({$_[0] lt $_[1]})
2727
}
2828

29-
ok(sorted(@words), "xt/words.pws is sorted");
30-
ok(sorted(@code), "xt/code.pws is sorted");
29+
ok(sorted(@words), "xt/pws/words.pws is sorted");
30+
ok(sorted(@code), "xt/pws/code.pws is sorted");
3131

3232
my @dupes = @words.Set @code.Set;
3333

34-
is(~@dupes, "", "No duplicates between xt/words.pws and xt/code.pws");
34+
is(~@dupes, "", "No duplicates between xt/pws/words.pws and xt/pws/code.pws");
3535

3636
# are all the words lower case?
3737
# (ignore some unicode that aspell doesn't case fold as well as we do.
@@ -40,10 +40,10 @@ sub get-uppers(@lexicon) {
4040
}
4141

4242
my $uppers = get-uppers(@words);
43-
is($uppers.elems, 0, "all words in xt/words.pws are lowercase");
43+
is($uppers.elems, 0, "all words in xt/pws/words.pws are lowercase");
4444
diag $uppers if $uppers.elems;
4545

4646
$uppers = get-uppers(@code);
47-
is($uppers.elems, 0, "all words in xt/code.pws are lowercase");
47+
is($uppers.elems, 0, "all words in xt/pws/code.pws are lowercase");
4848
diag $uppers if $uppers.elems;
4949

0 commit comments

Comments
 (0)