Skip to content

Instantly share code, notes, and snippets.

View MARTIMM's full-sized avatar
🏠
Working from home

Marcel Timmerman MARTIMM

🏠
Working from home
View GitHub Profile
#!/usr/bin/env perl6
use v6;
use JSON::Fast;
use CPAN::Uploader::Tiny;
#-------------------------------------------------------------------------------
sub MAIN ( *@p6-dirs is copy ) {
@p6-dirs //= ();
@MARTIMM
MARTIMM / datablock.pl6
Last active June 8, 2018 17:19
Use perl6 '=begin comment' pod blocks as data blocks
#!/usr/bin/env perl6
#`{{
Perl6 datablock are not yet implemented so $=data will generate an error.
After some testing I also found that the data between e.g. '=begin data' and
'=end data' are scooped up into one single string without any newline (\n).
This, I find, is an important character needed to separate lines. so
=begin data
a 1
b 2
=end data
@MARTIMM
MARTIMM / dies-ok.pl6
Last active April 20, 2017 12:45
try-catch to replace dies-ok test
use v6;
use Test;
#------------------------------------------------------------------------------
d-ok( {die 'oh oh 0';}, 'oh oh 0');
d-ok( {die 'oh oh 1';}, 'oh oh 1', :name<X::AdHoc>);
d-ok( {die 'oh oh 2';}, 'oh oh 2', :message<oh oh 2>);
d-ok( {die 'oh oh 3';}, 'oh oh 3', :name<X::AdHoc>, :message<oh oh 3> );
d-ok( {die 'oh oh 4';}, 'oh oh 4', :name<X::AdHoc>, :message(/ '4' $/) );
# Dies without knowing that the method Lisp does not exist!
@MARTIMM
MARTIMM / appveyor.yml
Last active May 30, 2018 17:49
perl6 appveyor script to test module for windows
os: Visual Studio 2015
platform: x64
branches:
# whitelist
only:
- master
install:
@MARTIMM
MARTIMM / prove-until-fail.pl6
Created November 5, 2016 18:08
test infinetly until fail
#!/usr/bin/env perl6
use v6.c;
sub MAIN ( Str:D $filename where (.IO ~~ :r and .IO !~~ :d) ) {
my Proc $p;
my Bool $success = True;
while $success {