<commit_before>#!/usr/bin/perl -w

use Cwd;
use File::Path;
use File::Copy;
use File::Spec;
use File::Basename;

my $base_path = Cwd::abs_path("$0/../..");

File::Path::make_path("$base_path/test/build");
`perl $base_path/bin/perl-to-js.pl bundle Dummy::Simple Dummy::Complex Dummy::Module --include $base_path/test/lib --output $base_path/test/build/bundle.js`;
`perl $base_path/bin/perl-to-js.pl interface --output $base_path/test/build/interface.js`;
globCopy("$base_path/test/assets", "$base_path/test/build", "* */*");

sub globCopy {
	my ($src, $dest, $glob) = @_;
	my $abs_glob = join(' ', map {"$src/$_"} split(' ', $glob));
	for my $abs_fn (glob($abs_glob)){
		if (-f $abs_fn){
			my $fn = File::Spec->abs2rel($abs_fn, $src);
			my (undef, $dir, undef) = File::Basename::fileparse("$dest/$fn");
			File::Path::make_path($dir);
			copy("$src/$fn", "$dest/$fn") or die $!;
		}
	}
}<commit_msg>Fix test/build.pl for renaming perl-to-js.pl -> perltojs.pl<commit_after>#!/usr/bin/perl -w

use Cwd;
use File::Path;
use File::Copy;
use File::Spec;
use File::Basename;

my $base_path = Cwd::abs_path("$0/../..");

File::Path::make_path("$base_path/test/build");
`perl $base_path/bin/perltojs.pl bundle Dummy::Simple Dummy::Complex Dummy::Module --include $base_path/test/lib --output $base_path/test/build/bundle.js`;
`perl $base_path/bin/perltojs.pl interface --output $base_path/test/build/interface.js`;
globCopy("$base_path/test/assets", "$base_path/test/build", "* */*");

sub globCopy {
	my ($src, $dest, $glob) = @_;
	my $abs_glob = join(' ', map {"$src/$_"} split(' ', $glob));
	for my $abs_fn (glob($abs_glob)){
		if (-f $abs_fn){
			my $fn = File::Spec->abs2rel($abs_fn, $src);
			my (undef, $dir, undef) = File::Basename::fileparse("$dest/$fn");
			File::Path::make_path($dir);
			copy("$src/$fn", "$dest/$fn") or die $!;
		}
	}
}
{'fraction_non_alphanumeric': 0.23561346362649294, 'fraction_numerical': 0.002171552660152009, 'mean_word_length': 4.79559748427673, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2074509', 'n_tokens_mistral': 772, 'n_tokens_neox': 736, 'n_words': 139}