@fraczak/k 8.5.1 → 8.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/DOCS/CODECS.md +54 -0
- package/DOCS/REPL.md +2 -0
- package/Examples/djson.k +443 -328
- package/Examples/ieee-arithmetics.k +7183 -0
- package/Examples/ieee.k +895 -7374
- package/Examples/poly.k +1 -1
- package/README.md +3 -2
- package/backends/wasm/tests/integration.sh +2 -1
- package/browser/shims/fs.mjs +1 -0
- package/canonical-pattern.mjs +341 -3
- package/object.mjs +19 -10
- package/package.json +1 -1
- package/repl.mjs +287 -22
- package/scripts/benchmark-idempotency.mjs +20 -5
- package/scripts/benchmark.mjs +42 -10
- package/scripts/build-repl-html.mjs +11 -0
- package/scripts/perf-ieee.mjs +9 -16
- package/scripts/render-benchmark.mjs +1 -1
- package/scripts/run-tests.mjs +2 -0
- package/tests/README.md +2 -0
- package/tests/integration.sh +2 -1
- package/tests/test-djson-methods.mjs +11 -1
- package/tests/test-ieee-arithmetic.mjs +3 -1
- package/tests/test-ieee-text.mjs +59 -0
- package/tests/test-k-object.mjs +9 -0
- package/tests/test-parse-json.mjs +96 -0
- package/tests/test-repl-html.mjs +1 -0
- package/tests/test-repl.mjs +209 -21
package/tests/test-repl.mjs
CHANGED
|
@@ -26,11 +26,19 @@ const state = createState();
|
|
|
26
26
|
|
|
27
27
|
let output = await evaluateInput("zero = {} | zero;", state);
|
|
28
28
|
output = await evaluateInput(":rel zero", state);
|
|
29
|
-
assert.
|
|
29
|
+
assert.equal(
|
|
30
|
+
output[0],
|
|
31
|
+
"zero = ?(...) {} |zero ?<{} zero, ...>; " +
|
|
32
|
+
"-- @ZdauiYp7DqPGmHkUiG8yuWz4ZbEgvxZyNkBAmJ4ENhAX"
|
|
33
|
+
);
|
|
30
34
|
|
|
31
35
|
output = await evaluateInput("succ = | succ;", state);
|
|
32
36
|
output = await evaluateInput(":rel succ", state);
|
|
33
|
-
assert.
|
|
37
|
+
assert.equal(
|
|
38
|
+
output[0],
|
|
39
|
+
"succ = ?X0 |succ ?<X0 succ, ...>; " +
|
|
40
|
+
"-- @SwjzXdcxv8ZbpCkF4cXGtgKkqPTfYqGGP5erQE7DCCsj"
|
|
41
|
+
);
|
|
34
42
|
|
|
35
43
|
output = await evaluateInput(":rels", state);
|
|
36
44
|
assert.match(output[0], /^zero = @/m);
|
|
@@ -306,19 +314,13 @@ assert.equal(output[0], "loaded Examples/arithmetics.k");
|
|
|
306
314
|
output = await evaluateInput(":pat bits", arithState);
|
|
307
315
|
assert.equal(
|
|
308
316
|
output[0],
|
|
309
|
-
"bits[] = <
|
|
317
|
+
"bits[] = <X0 0, X0 1, {} _>=X0; -- " +
|
|
310
318
|
"@VtPHxGf5GNMzzyVFxtv7gegFfJRYapBGtCeyV56bs5Zb[]"
|
|
311
319
|
);
|
|
312
|
-
// output = await evaluateInput(":pat bit", arithState);
|
|
313
|
-
// assert.equal(
|
|
314
|
-
// output[0],
|
|
315
|
-
// "bit[] = <{} 0, {} 1>; -- " +
|
|
316
|
-
// "@MjusyRWZnVj8TR4BhFCCcMRrQbdKp9gPtC29LT9nZvjg[]"
|
|
317
|
-
// );
|
|
318
320
|
output = await evaluateInput(":pat int[]", arithState);
|
|
319
321
|
assert.equal(
|
|
320
322
|
output[0],
|
|
321
|
-
"int[] =
|
|
323
|
+
"int[] = <<X0 0, X0 1, {} _>=X0 +, X0 ->; -- " +
|
|
322
324
|
"@Nws3vysWqC9PznraTP4kWPp44Rd77NAqrx9dgbtHAjGA[]"
|
|
323
325
|
);
|
|
324
326
|
output = await evaluateInput("10", arithState);
|
|
@@ -400,6 +402,7 @@ output = await evaluateInput("test utf8", utf8AutoState);
|
|
|
400
402
|
assert.match(output[0], /utf8\.mjs: test utf8/);
|
|
401
403
|
|
|
402
404
|
const ieeeAutoState = createState();
|
|
405
|
+
await evaluateInput(":load core.k", ieeeAutoState);
|
|
403
406
|
await evaluateInput(":load Examples/ieee.k", ieeeAutoState);
|
|
404
407
|
output = await evaluateInput(":codec load ./codecs/ieee.mjs", ieeeAutoState);
|
|
405
408
|
assert.match(output[0], /^loaded codec ieee\.mjs/);
|
|
@@ -625,6 +628,8 @@ assert.equal(output[0], "Current output limit: none");
|
|
|
625
628
|
|
|
626
629
|
// Verify Examples/djson.k (json?, get, nth, set, del)
|
|
627
630
|
const djsonKState = createState({ engine: "wasm" });
|
|
631
|
+
await evaluateInput(":load core.k", djsonKState);
|
|
632
|
+
await evaluateInput(":load Examples/ieee.k", djsonKState);
|
|
628
633
|
output = await evaluateInput(":load Examples/djson.k", djsonKState);
|
|
629
634
|
assert.equal(output[0], "loaded Examples/djson.k");
|
|
630
635
|
await evaluateInput(":codec load codecs/djson.mjs", djsonKState);
|
|
@@ -675,19 +680,19 @@ assert.equal(
|
|
|
675
680
|
output = await evaluateInput(":pattern bit", patState);
|
|
676
681
|
assert.equal(
|
|
677
682
|
output[0],
|
|
678
|
-
"bit[] = <{} 0,
|
|
683
|
+
"bit[] = <{}=X0 0, X0 1>; -- " +
|
|
679
684
|
"@MjusyRWZnVj8TR4BhFCCcMRrQbdKp9gPtC29LT9nZvjg[]"
|
|
680
685
|
);
|
|
681
686
|
output = await evaluateInput(":pattern bit[]", patState);
|
|
682
687
|
assert.equal(
|
|
683
688
|
output[0],
|
|
684
|
-
"bit[] = <{} 0,
|
|
689
|
+
"bit[] = <{}=X0 0, X0 1>; -- " +
|
|
685
690
|
"@MjusyRWZnVj8TR4BhFCCcMRrQbdKp9gPtC29LT9nZvjg[]"
|
|
686
691
|
);
|
|
687
692
|
output = await evaluateInput(":pat bit", patState);
|
|
688
693
|
assert.equal(
|
|
689
694
|
output[0],
|
|
690
|
-
"bit[] = <{} 0,
|
|
695
|
+
"bit[] = <{}=X0 0, X0 1>; -- " +
|
|
691
696
|
"@MjusyRWZnVj8TR4BhFCCcMRrQbdKp9gPtC29LT9nZvjg[]"
|
|
692
697
|
);
|
|
693
698
|
output = await evaluateInput(
|
|
@@ -709,8 +714,8 @@ output = await evaluateInput(
|
|
|
709
714
|
output = await evaluateInput(":pattern byte", patState);
|
|
710
715
|
assert.equal(
|
|
711
716
|
output[0],
|
|
712
|
-
"byte[] = {
|
|
713
|
-
"
|
|
717
|
+
"byte[] = {<{}=X1 0, X1 1>=X0 b0, X0 b1, X0 b2, X0 b3, " +
|
|
718
|
+
"X0 b4, X0 b5, X0 b6, X0 b7}; -- " +
|
|
714
719
|
"@4ukq2gpiEBFa7WXxcfRm8pfdr2kgYLTTnwsmLHeMd9i5[]"
|
|
715
720
|
);
|
|
716
721
|
|
|
@@ -773,7 +778,7 @@ assert(output[0].includes("pair[A,B] = @KqTB"));
|
|
|
773
778
|
output = await evaluateInput(":pattern list", patState);
|
|
774
779
|
assert.equal(
|
|
775
780
|
output[0],
|
|
776
|
-
"list[X] = <{
|
|
781
|
+
"list[X] = <{X car, X0 cdr} cons, {} nil>=X0; -- " +
|
|
777
782
|
"@JagVexzgseRr4rVZRmVpsMbr2AKXDjzZnz6Qnf8a9SNe[X]"
|
|
778
783
|
);
|
|
779
784
|
|
|
@@ -801,13 +806,13 @@ assert.equal(
|
|
|
801
806
|
output = await evaluateInput(":pattern pair", freshState);
|
|
802
807
|
assert.equal(
|
|
803
808
|
output[0],
|
|
804
|
-
"pair[A, B] = {
|
|
809
|
+
"pair[A, B] = {A first, B second}; -- " +
|
|
805
810
|
"@KqTBNkznjWWwync2Mm94XjCez63neJBJtgYcJJEE5kEm[A, B]"
|
|
806
811
|
);
|
|
807
812
|
output = await evaluateInput(":pattern list", freshState);
|
|
808
813
|
assert.equal(
|
|
809
814
|
output[0],
|
|
810
|
-
"list[X] = <{
|
|
815
|
+
"list[X] = <{X car, X0 cdr} cons, {} nil>=X0; -- " +
|
|
811
816
|
"@JagVexzgseRr4rVZRmVpsMbr2AKXDjzZnz6Qnf8a9SNe[X]"
|
|
812
817
|
);
|
|
813
818
|
output = await evaluateInput(
|
|
@@ -827,7 +832,7 @@ output = await evaluateInput("a[] = x;", freshState);
|
|
|
827
832
|
output = await evaluateInput(":pattern a", freshState);
|
|
828
833
|
assert.equal(
|
|
829
834
|
output[0],
|
|
830
|
-
"a[] =
|
|
835
|
+
"a[] = (...); -- " +
|
|
831
836
|
"@QfyLpmn56wuppuGvrrUJz8LKtgaXfbMtad7RnzBcFk2S[(...)]"
|
|
832
837
|
);
|
|
833
838
|
output = await evaluateInput(
|
|
@@ -849,13 +854,13 @@ output = await evaluateInput(
|
|
|
849
854
|
output = await evaluateInput(":pat a", freshState);
|
|
850
855
|
assert.equal(
|
|
851
856
|
output[0],
|
|
852
|
-
"a[] = {
|
|
857
|
+
"a[] = {(...) x, (...) y}; -- " +
|
|
853
858
|
"@NPSHm9HbPgXmGHVGMJGJFq7rq4LiFiavPX27mUwyE26x[(...), (...)]"
|
|
854
859
|
);
|
|
855
860
|
output = await evaluateInput(":pat b", freshState);
|
|
856
861
|
assert.equal(
|
|
857
862
|
output[0],
|
|
858
|
-
"b[X] = {X x,
|
|
863
|
+
"b[X] = {X x, (...) y}; -- " +
|
|
859
864
|
"@NPSHm9HbPgXmGHVGMJGJFq7rq4LiFiavPX27mUwyE26x[X, (...)]"
|
|
860
865
|
);
|
|
861
866
|
output = await evaluateInput(":pat c", freshState);
|
|
@@ -969,6 +974,189 @@ assert(
|
|
|
969
974
|
)
|
|
970
975
|
);
|
|
971
976
|
|
|
977
|
+
// Verify :rel prints inline when <= 45 and canonical pattern names when > maxPatLength
|
|
978
|
+
output = await evaluateInput(":rel reverse", polyExplicitState);
|
|
979
|
+
assert.equal(
|
|
980
|
+
output[0],
|
|
981
|
+
"reverse = ?<{(...) car, X0 cdr} cons, {} nil>=X0 " +
|
|
982
|
+
"{() xs, nil acc} _reverse ?X0; " +
|
|
983
|
+
"-- @JbJ2aQugNct2GGeCJ65zKjN55Bf5YPyGHzsikTCjx82w"
|
|
984
|
+
);
|
|
985
|
+
await evaluateInput(":max-pat-length 30", polyExplicitState);
|
|
986
|
+
output = await evaluateInput(":rel car", polyExplicitState);
|
|
987
|
+
assert.equal(
|
|
988
|
+
output[0],
|
|
989
|
+
"car = ?@JagVexzgseRr4rVZRmVpsMbr2AKXDjzZnz6Qnf8a9SNe[X0] " +
|
|
990
|
+
"/cons .car ?X0; " +
|
|
991
|
+
"-- @zjRvxpKqktzNfR3VYSqq4bF9XLQTnCp4MpP82JLmysaP"
|
|
992
|
+
);
|
|
993
|
+
output = await evaluateInput(":rel reverse", polyExplicitState);
|
|
994
|
+
assert.equal(
|
|
995
|
+
output[0],
|
|
996
|
+
"reverse = ?@JagVexzgseRr4rVZRmVpsMbr2AKXDjzZnz6Qnf8a9SNe[X0] " +
|
|
997
|
+
"{() xs, nil acc} _reverse " +
|
|
998
|
+
"?@JagVexzgseRr4rVZRmVpsMbr2AKXDjzZnz6Qnf8a9SNe[X0]; " +
|
|
999
|
+
"-- @JbJ2aQugNct2GGeCJ65zKjN55Bf5YPyGHzsikTCjx82w"
|
|
1000
|
+
);
|
|
1001
|
+
output = await evaluateInput(":rel nil?", polyExplicitState);
|
|
1002
|
+
assert.equal(
|
|
1003
|
+
output[0],
|
|
1004
|
+
"nil? = ?@JagVexzgseRr4rVZRmVpsMbr2AKXDjzZnz6Qnf8a9SNe[(...)] " +
|
|
1005
|
+
"/nil nil " +
|
|
1006
|
+
"?@JagVexzgseRr4rVZRmVpsMbr2AKXDjzZnz6Qnf8a9SNe[(...)]; " +
|
|
1007
|
+
"-- @YHZEettEijtfW68ekdSKKiZRfiiEkqJjLDb9NNcJnwcg"
|
|
1008
|
+
);
|
|
1009
|
+
output = await evaluateInput(":rel parseJson", djsonKState);
|
|
1010
|
+
assert.equal(
|
|
1011
|
+
output[0],
|
|
1012
|
+
"parseJson = " +
|
|
1013
|
+
"?@Pt3MwQwzUPxQKu58zXR3qUBHWTzfycx5bSZGzcK6EZQK[] " +
|
|
1014
|
+
"json_value {.rest ws /nil end, .value value} .value " +
|
|
1015
|
+
"?@P5C7TQKTSPnFUkYkYzTudJamxAQ3T3fHbvZNqwWMfAA2[]; " +
|
|
1016
|
+
"-- @tWaZchv9AbbWxSHVk8nBpz8jVnjswiwDNhpFZeFwg6Pt"
|
|
1017
|
+
);
|
|
1018
|
+
const shortThresholdState = createState();
|
|
1019
|
+
output = await evaluateInput(":max-pat-length", shortThresholdState);
|
|
1020
|
+
assert.equal(output[0], "Current max pattern length: 45");
|
|
1021
|
+
output = await evaluateInput(":maxPatLength 10", shortThresholdState);
|
|
1022
|
+
assert.equal(output[0], "max pattern length set to 10");
|
|
1023
|
+
output = await evaluateInput(":max-pat-length", shortThresholdState);
|
|
1024
|
+
assert.equal(output[0], "Current max pattern length: 10");
|
|
1025
|
+
await evaluateInput("zero = {} | zero;", shortThresholdState);
|
|
1026
|
+
output = await evaluateInput(":rel zero", shortThresholdState);
|
|
1027
|
+
assert.equal(
|
|
1028
|
+
output[0],
|
|
1029
|
+
"zero = ?(...) {} |zero " +
|
|
1030
|
+
"?@92TYLAz9F3GXM3pwDZhN8rD8vKTRJhX9hS44HzS9WKdM[]; " +
|
|
1031
|
+
"-- @ZdauiYp7DqPGmHkUiG8yuWz4ZbEgvxZyNkBAmJ4ENhAX"
|
|
1032
|
+
);
|
|
1033
|
+
output = await evaluateInput(
|
|
1034
|
+
":pat @92TYLAz9F3GXM3pwDZhN8rD8vKTRJhX9hS44HzS9WKdM",
|
|
1035
|
+
shortThresholdState
|
|
1036
|
+
);
|
|
1037
|
+
assert.equal(
|
|
1038
|
+
output[0],
|
|
1039
|
+
"@92TYLAz9F3GXM3pwDZhN8rD8vKTRJhX9hS44HzS9WKdM[] = <{} zero, ...>;"
|
|
1040
|
+
);
|
|
1041
|
+
output = await evaluateInput(
|
|
1042
|
+
":pat ?@92TYLAz9F3GXM3pwDZhN8rD8vKTRJhX9hS44HzS9WKdM",
|
|
1043
|
+
shortThresholdState
|
|
1044
|
+
);
|
|
1045
|
+
assert.equal(
|
|
1046
|
+
output[0],
|
|
1047
|
+
"@92TYLAz9F3GXM3pwDZhN8rD8vKTRJhX9hS44HzS9WKdM[] = <{} zero, ...>;"
|
|
1048
|
+
);
|
|
1049
|
+
output = await evaluateInput(
|
|
1050
|
+
":pat ?@92TYLAz9F3GXM3pwDZhN8rD8vKTRJhX9hS44HzS9WKdM[]",
|
|
1051
|
+
shortThresholdState
|
|
1052
|
+
);
|
|
1053
|
+
assert.equal(
|
|
1054
|
+
output[0],
|
|
1055
|
+
"@92TYLAz9F3GXM3pwDZhN8rD8vKTRJhX9hS44HzS9WKdM[] = <{} zero, ...>;"
|
|
1056
|
+
);
|
|
1057
|
+
completions = completeInput(":pat ?@92TY", shortThresholdState)[0];
|
|
1058
|
+
assert(
|
|
1059
|
+
completions.includes(
|
|
1060
|
+
":pat ?@92TYLAz9F3GXM3pwDZhN8rD8vKTRJhX9hS44HzS9WKdM"
|
|
1061
|
+
)
|
|
1062
|
+
);
|
|
1063
|
+
output = await evaluateInput(":max-pat-length none", shortThresholdState);
|
|
1064
|
+
assert.equal(output[0], "max pattern length disabled");
|
|
1065
|
+
output = await evaluateInput(":maxPatLength", shortThresholdState);
|
|
1066
|
+
assert.equal(output[0], "Current max pattern length: none");
|
|
1067
|
+
output = await evaluateInput(":rel zero", shortThresholdState);
|
|
1068
|
+
assert.equal(
|
|
1069
|
+
output[0],
|
|
1070
|
+
"zero = ?(...) {} |zero ?<{} zero, ...>; " +
|
|
1071
|
+
"-- @ZdauiYp7DqPGmHkUiG8yuWz4ZbEgvxZyNkBAmJ4ENhAX"
|
|
1072
|
+
);
|
|
1073
|
+
completions = completeInput(":max", shortThresholdState)[0];
|
|
1074
|
+
assert(completions.includes(":max-pat-length"));
|
|
1075
|
+
assert(completions.includes(":maxPatLength"));
|
|
1076
|
+
|
|
1077
|
+
// Verify canonical :pat output and :all-patterns / :all-pats
|
|
1078
|
+
const allPatState = createState();
|
|
1079
|
+
output = await evaluateInput(":all-patterns", allPatState);
|
|
1080
|
+
assert.equal(output[0], "(none)");
|
|
1081
|
+
await evaluateInput("p[X,Y] = {X x, Y y};", allPatState);
|
|
1082
|
+
await evaluateInput("bit[] = <{} 1, {} 0>;", allPatState);
|
|
1083
|
+
await evaluateInput("u[] = p[bit[], bit[]];", allPatState);
|
|
1084
|
+
await evaluateInput("w[] = {<{} 0, {} 1>=X x, X y};", allPatState);
|
|
1085
|
+
output = await evaluateInput(":pat u", allPatState);
|
|
1086
|
+
assert.equal(
|
|
1087
|
+
output[0],
|
|
1088
|
+
"u[] = {<{}=X1 0, X1 1>=X0 x, X0 y}; " +
|
|
1089
|
+
"-- @akFfWqqyH7nALkFxD2ixhF46W2FMeymuhAGxtbN2hPew[]"
|
|
1090
|
+
);
|
|
1091
|
+
output = await evaluateInput(":pat w", allPatState);
|
|
1092
|
+
assert.equal(
|
|
1093
|
+
output[0],
|
|
1094
|
+
"w[] = {<{}=X1 0, X1 1>=X0 x, X0 y}; " +
|
|
1095
|
+
"-- @akFfWqqyH7nALkFxD2ixhF46W2FMeymuhAGxtbN2hPew[]"
|
|
1096
|
+
);
|
|
1097
|
+
output = await evaluateInput(":all-patterns", allPatState);
|
|
1098
|
+
assert.equal(
|
|
1099
|
+
output[0],
|
|
1100
|
+
[
|
|
1101
|
+
"@MjusyRWZnVj8TR4BhFCCcMRrQbdKp9gPtC29LT9nZvjg[] = " +
|
|
1102
|
+
"<{}=X0 0, X0 1>; -- bit[] = @[]",
|
|
1103
|
+
"@NPSHm9HbPgXmGHVGMJGJFq7rq4LiFiavPX27mUwyE26x[X0,X1] = " +
|
|
1104
|
+
"{X0 x, X1 y}; -- p[X,Y] = @[X,Y]",
|
|
1105
|
+
"@akFfWqqyH7nALkFxD2ixhF46W2FMeymuhAGxtbN2hPew[] = " +
|
|
1106
|
+
"{<{}=X1 0, X1 1>=X0 x, X0 y}; -- u[] = @[], w[] = @[]"
|
|
1107
|
+
].join("\n")
|
|
1108
|
+
);
|
|
1109
|
+
output = await evaluateInput(":all-pats", allPatState);
|
|
1110
|
+
assert.equal(
|
|
1111
|
+
output[0],
|
|
1112
|
+
[
|
|
1113
|
+
"@MjusyRWZnVj8TR4BhFCCcMRrQbdKp9gPtC29LT9nZvjg[] = " +
|
|
1114
|
+
"<{}=X0 0, X0 1>; -- bit[] = @[]",
|
|
1115
|
+
"@NPSHm9HbPgXmGHVGMJGJFq7rq4LiFiavPX27mUwyE26x[X0,X1] = " +
|
|
1116
|
+
"{X0 x, X1 y}; -- p[X,Y] = @[X,Y]",
|
|
1117
|
+
"@akFfWqqyH7nALkFxD2ixhF46W2FMeymuhAGxtbN2hPew[] = " +
|
|
1118
|
+
"{<{}=X1 0, X1 1>=X0 x, X0 y}; -- u[] = @[], w[] = @[]"
|
|
1119
|
+
].join("\n")
|
|
1120
|
+
);
|
|
1121
|
+
|
|
1122
|
+
const pqState = createState();
|
|
1123
|
+
await evaluateInput("p[X] = {X x, Y y};", pqState);
|
|
1124
|
+
await evaluateInput("q[ZZZ] = {ZZZ x, ZZZ y};", pqState);
|
|
1125
|
+
output = await evaluateInput(":all-pat", pqState);
|
|
1126
|
+
assert.equal(
|
|
1127
|
+
output[0],
|
|
1128
|
+
"@NPSHm9HbPgXmGHVGMJGJFq7rq4LiFiavPX27mUwyE26x[X0,X1] = " +
|
|
1129
|
+
"{X0 x, X1 y}; -- p[X] = @[X,(...)], q[ZZZ] = @[ZZZ,ZZZ]"
|
|
1130
|
+
);
|
|
1131
|
+
completions = completeInput(":all", allPatState)[0];
|
|
1132
|
+
assert(completions.includes(":all-patterns"));
|
|
1133
|
+
assert(completions.includes(":all-pat"));
|
|
1134
|
+
|
|
1135
|
+
const relPatState = createState();
|
|
1136
|
+
await evaluateInput("ww = ?<{} x, {}y, Z z > = Z;", relPatState);
|
|
1137
|
+
output = await evaluateInput(":pats", relPatState);
|
|
1138
|
+
assert.equal(output[0], "(none)");
|
|
1139
|
+
output = await evaluateInput(":all-pats", relPatState);
|
|
1140
|
+
assert.equal(
|
|
1141
|
+
output[0],
|
|
1142
|
+
"@zJ4APgx8cLrV6EeNJjePDU25sEkNH5AX7CUjFWmCAwhY[] = " +
|
|
1143
|
+
"<{}=X1 x, X1 y, X0 z>=X0;"
|
|
1144
|
+
);
|
|
1145
|
+
output = await evaluateInput(":rel ww", relPatState);
|
|
1146
|
+
assert.equal(
|
|
1147
|
+
output[0],
|
|
1148
|
+
"ww = ?<{}=X1 x, X1 y, X0 z>=X0 () ?X0; " +
|
|
1149
|
+
"-- @VmhPa6q6x9eeN8pnyJnz89w9GVjNhWtz5zZghJb4zjUx"
|
|
1150
|
+
);
|
|
1151
|
+
await evaluateInput(":max-pat-length 10", relPatState);
|
|
1152
|
+
output = await evaluateInput(":rel ww", relPatState);
|
|
1153
|
+
assert.equal(
|
|
1154
|
+
output[0],
|
|
1155
|
+
"ww = ?@zJ4APgx8cLrV6EeNJjePDU25sEkNH5AX7CUjFWmCAwhY[] () " +
|
|
1156
|
+
"?@zJ4APgx8cLrV6EeNJjePDU25sEkNH5AX7CUjFWmCAwhY[]; " +
|
|
1157
|
+
"-- @VmhPa6q6x9eeN8pnyJnz89w9GVjNhWtz5zZghJb4zjUx"
|
|
1158
|
+
);
|
|
1159
|
+
|
|
972
1160
|
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
973
1161
|
fs.rmSync(symlinkPath, { force: true });
|
|
974
1162
|
console.log("OK");
|