### ----------------------------------------------------
### -- App::Crag
### -- Licenses: Artistic-2.0
### -- Authors: librasteve
### -- File: xt/02-cotd.rakutest
### ----------------------------------------------------
use Test;
use App::Crag;

use MONKEY-SEE-NO-EVAL;

my $cotd = q:to/END/;
crag '$t=^<22:04:22>; say $t.in: <millisecs>'
crag '{say $^w * $^l}(1.1m±1%, 2.4m±4%)'
crag 'say ^<343 m/s ±1> .in: <mph>'
crag 'say e ** (i * π) =~= -1'
crag '$d=7cm ±3%; say π * $d'
crag 'say (^<1676 km> / (^<12:38:00> - ^<10:22:00>)).in: <mph>'
crag 'say "{2/0==1/0}, {1/0==0/0}"'
crag 'say (1 / ^<30 mpg>).in: <l/100km>'
crag 'say (c* ^<13.8 gigayears>).in: <megaparsec>'
crag 'say ^<13.8 billion years> .rebase.norm'
crag '$h=450;$w=1520;$d=2315;$v=$h*$w*$d; say (^"$v cubic millimetre").in: <cords>'    #hilux load 0.44cord
crag '$h=69;$w=31+21;$d=21+43;$v=$h*$w*$d; say (^"$v cu in").in: <cords>'      #my logpile
crag 'say ^<1.04 cord> * ^<500 kg/m^3>'
crag 'say (^<1884 kg> * ^<16 MJ/kg>).in: <kWh>'
crag 'r(0); say ^<1 Dalton> .rebase'
crag 'say π²'
crag 'r(1e-13); say α'
crag '$i=∞; say $i++'
crag '$body-temp = 36.8°C; say "Healthy" if $body-temp == 36.6°C ± 3%'
crag 'say "Voltage is {20A * 10kΩ}"'
crag '$x = <௪௨>, say "$x is Tamil for {+$x}." '
crag 'say ^<௪௨ mph>'
crag '$fr-max=^<4 W/kg>; $iphone12=^<5.74 W/kg>; say "stop sales in fr" if $iphone12 > $fr-max'
crag '$tub=(1.4m * .5m * .3m); $tap=^<20 L/min>; say $tub/$tap'
crag 'r(0); say "boltzmann-constant is: ", k'
crag 'say 0rMCMXLIV'
crag 'say (0rXXIII + 0rMM).&to-roman'
crag '$circus-maximus-lap = ^<2000 ft>; $laps = 7; say $circus-maximus-lap * $laps;'
crag '$chariot-speed = ^<40 mph>; $race-distance = ^<14000 ft>; say $race-distance / $chariot-speed;'
crag '$s=Speed.new(value=>0rXL,units=>"mph"); $d=Distance.new(value=>0rMM,units=>"ft"); say "lap-time {$d/$s}"'
crag '$fd = ^"{[+] <3 1/2>} in"; say "Fits on a $fd floppy disk."'  #texas fractions
crag '$fd = ^<§|3½| in>; say "Fits on a $fd floppy disk."'  #unicode fractions
crag 'say 2**63-1'
crag 'say molecular-mass("SO2")'
crag "say chemical-element-data('Cl');"
crag 'say (50km * 0.5km * ^<2 m/s>).in("sverdrup")'     #https://tos.org/oceanography/article/is-the-atlantic-overturning-circulation-approaching-a-tipping-point
crag 'say (^<27 cubic hectometer per sec>).in("sverdrup")'
crag 'say %vw-golf1=(:mass(800kg), :cc(1.8l),:hp(^<112 hp>),:burn(^<10 l/100km>))'
crag 'say %vw-golf8=(:mass(1450kg),:cc(1.0l),:hp(^<110 hp>),:burn(^<4.6 l/100km>))'
crag 'say (180kW/1450kg)'
crag 'say ^<§|10⁵/₁₂| ft> .in: <m>'
crag 'say ^<§|10 + ⁵/₁₂| ft> .in: <m>'
crag '%gin<double abv cal>=(50ml,^<40 %>,^<108 cal>); say %gin'
crag '%gin<double abv cal>=(50ml,^<40 %>,^<108 cal>); say (.<double> * .<abv> with %gin).in("alcohol-unit")'
crag '%wine<medium abv>=(175ml,^<12 %>,^<136 cal>); say %wine'
crag '%wine<medium abv>=(175ml,^<12 %>); say (.<medium> * .<abv> with %wine).in("alcohol-unit")'
crag '%beer<pint abv cal>=(^<1 pint>,^<5.0 %>,^<256 cal>); say %beer'
crag '%beer<pint abv cal>=(^<1 pint>,^<5.0 %>); say (.<pint> * .<abv> with %beer).in("alcohol-unit")'
crag 'say "p^=mv^"'
crag '$v^=^([1,2,3],"m/s"); $m=4kg; $p^=$m*$v^; say "p^=$p^"'
END

$cotd ~~ s:g/'#' .*? $$//;
$cotd ~~ s:g/"crag"/lives-ok \{ eval-me(/;
$cotd ~~ s:g/$$/ ) };/;

my @cotd = $cotd.lines;
plan +@cotd;

#say $cotd;
#.say, .EVAL for @cotd[^10];

EVAL $_ for @cotd;

# vim: expandtab shiftwidth=4


