TheSwanFactory / hclang

Homoiconic C - a universal data format for computation
https://theswanfactory.wordpress.com/2016/12/20/homoiconic-c-a-universal-language-for-code-and-data/
MIT License
4 stars 0 forks source link

pass testdocs #171

Closed drernie closed 10 months ago

drernie commented 11 months ago
$-.test-fail “() +“2” -()”;“{"total":33,"pass":11,"fail":22}”;
$-.test-fail “() +“7” -()”;“{"total":13,"pass":7,"fail":6}”;
$-.test-fail “() +“[.head 0b101; .tail 0b01100;]” -()”;“{"total":38,"pass":11,"fail":27}”;
$-.test-fail “() +“{0b1 0b0}” -()”;“{"total":21,"pass":10,"fail":11}”;
$-.test-fail ““#  inline comment # 4321” +() -“1234””;“{"total":6,"pass":5,"fail":1}”;
$-.test-fail ““.Bit <0b0, 0b1>;” +() -“(Bit)””;“{"total":19,"pass":10,"fail":9}”;
$-.test-fail ““.BitStream <[@Bit]>; # Variable-length Sequence of a specific type” +() -“(enum123)””;“{"total":30,"pass":11,"fail":19}”;
$-.test-fail ““.Byte <8@Bit>; # Fixed-length sequences” +() -“(Byte)””;“{"total":31,"pass":11,"fail":20}”;
$-.test-fail ““.false ()” +() -“false””;“{"total":24,"pass":11,"fail":13}”;
$-.test-fail ““.the-answer 42;” +() -“(the-answer)””;“{"total":9,"pass":6,"fail":3}”;
$-.test-fail ““.true <>” +() -“true””;“{"total":25,"pass":11,"fail":14}”;
$-.test-fail ““<.x, .z> [.x 1; .y 2; .z 3;] # Selector” +“[1, 3]” -“<x, z, [(x); (y); (z);]>””;“{"total":36,"pass":11,"fail":25}”;
$-.test-fail ““@enum123 4” +“$@enum123<1,2,3> 4” -“enum123””;“{"total":35,"pass":11,"fail":24}”;
$-.test-fail ““AppendZero” +() -“(AppendZero)””;“{"total":20,"pass":10,"fail":10}”;
$-.test-fail ““BitSplitter3 0b10101100” +() -“(BitSplitter3)””;“{"total":37,"pass":11,"fail":26}”;
$-.test-fail ““[.a 1; .b 2;].a” +“1” -“$!.name-missing “$:FrameArray.1164.a”;””;“{"total":23,"pass":11,"fail":12}”;
$-.test-fail ““[0b101, 0b010] .& AppendZero” +“[0b1010, 0b0100]” -“[0b1000, 0b1000]””;“{"total":28,"pass":11,"fail":17}”;
$-.test-fail ““[0b101, 0b010] .| AppendZero” +“0b10100100” -“0b10000010””;“{"total":29,"pass":11,"fail":18}”;
$-.test-fail ““`Expression1`,`Expression2`” +“`Expression1`,`Expression2`” -“(`Expression1`, `Expression2`)””;“{"total":15,"pass":8,"fail":7}”;
$-.test-fail ““`Hello`` World`” +“`Hello World`” -““Hello World”””;“{"total":8,"pass":6,"fail":2}”;
$-.test-fail ““`Statement`;” +() -“(`Statement`)””;“{"total":16,"pass":8,"fail":8}”;
$-.test-fail ““enum123.<>” +“<1,2,3>” -“$!.name-missing “$:FrameNumber.1652.”; .++ [<>];””;“{"total":34,"pass":11,"fail":23}”;
$-.test-fail ““enum123” +() -“(enum123)””;“{"total":32,"pass":11,"fail":21}”;
$-.test-fail ““false .? `Yes` .: `No`” +“`No`” -“$!.name-missing “$:HCTest.117.false”; .++ [?, `Yes`, :, `No`];””;“{"total":27,"pass":11,"fail":16}”;
$-.test-fail ““the-answer” +() -“(the-answer)””;“{"total":12,"pass":7,"fail":5}”;
$-.test-fail ““ther-answer” +“$ther-answer” -“$!.name-missing “$:HCTest.117.ther-answer”;””;“{"total":11,"pass":7,"fail":4}”;
$-.test-fail ““true .? `Yes` .: `No`” +“`Yes`” -“()””;“{"total":26,"pass":11,"fail":15}”;
drernie commented 11 months ago

ALSO: why does "-t" have to be at the end?

Is this the right benchmark?

Should we be doing urbit first?

drernie commented 11 months ago

node lib/src/cli/hc.js hc/hc-paper-enp.hc -t

$-.test-fail “““Want ” 2“Live” # evaluates `2“Live”` first” +““Want LiveLive”” -““Want 2Live”””;“{"total":8,"pass":5,"fail":3}”;
$-.test-fail “““Want ” (2 “Live”) # evaluates grouped expressions first” +““Want LiveLive”” -““Want Live”””;“{"total":9,"pass":5,"fail":4}”;
$-.test-fail ““{42; “Life, ” “The Universe, ” “Everything.”} ()” +““Life, The Universe, Everything.”” -“(42)””;“{"total":11,"pass":6,"fail":5}”;
$-.test-fail ““{} [“Life, ” “The Universe, ” “Everything.”]” +“{ “Life, ” “The Universe, ” “Everything.” }” -“(“Life, The Universe, Everything.”)””;“{"total":12,"pass":6,"fail":6}”;
LexPipe.perform.pop.failed: already at top level
$-.test-fail ““mag []” +“25” -“(.hc 0x0; .#  “25”; .;  “mag []”;)””;“{"total":13,"pass":6,"fail":7}”;