Created
April 13, 2019 15:22
-
-
Save zzamboni/cf5bbf62906b8d65926bf1183e789896 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Start testing: Apr 13 17:20 CEST | |
---------------------------------------------------------- | |
1/1 Testing: all | |
1/1 Test: all | |
Command: "/usr/local/bin/bash" "-c" "NGS_BOOTSTRAP=/Users/taazadi1/Downloads/ngs-0.2.6/lib/bootstrap.ngs NGS_DIR=/Users/taazadi1/Downloads/ngs-0.2.6/lib /Users/taazadi1/Downloads/ngs-0.2.6/build/ngs /Users/taazadi1/Downloads/ngs-0.2.6/test.ngs" | |
Directory: /Users/taazadi1/Downloads/ngs-0.2.6/build | |
"all" start time: Apr 13 17:20 CEST | |
Output: | |
---------------------------------------------------------- | |
[WARNING 2019-04-13 17:20:03 CEST] Using deprecated filter(e) | |
[WARNING 2019-04-13 17:20:04 CEST] Using deprecated n(Hash) | |
[WARNING 2019-04-13 17:20:04 CEST] Using deprecated max(Eachable1, Fun) | |
[WARNING 2019-04-13 17:20:04 CEST] Using deprecated max(Eachable1, Fun) | |
[ERROR 2019-04-13 17:20:04 CEST] +-------------------------------------------+ | |
[ERROR 2019-04-13 17:20:04 CEST] | Executing external process 'false' failed | | |
[ERROR 2019-04-13 17:20:04 CEST] | Command: false | | |
[ERROR 2019-04-13 17:20:04 CEST] | Command exited with code: 1 | | |
[ERROR 2019-04-13 17:20:04 CEST] +-------------------------------------------+ | |
[ERROR 2019-04-13 17:20:04 CEST] Exception of type ProcessFail occurred | |
[ERROR 2019-04-13 17:20:04 CEST] Info: process: | |
[ERROR 2019-04-13 17:20:04 CEST] Process | |
[ERROR 2019-04-13 17:20:04 CEST] command = <Command options={} redirects=[] argv=[false]> | |
[ERROR 2019-04-13 17:20:04 CEST] pid = 55845 | |
[ERROR 2019-04-13 17:20:04 CEST] exit_code = 1 | |
[ERROR 2019-04-13 17:20:04 CEST] exit_signal = null | |
[ERROR 2019-04-13 17:20:04 CEST] redirects[0]: <ProcessRedir fd=1 marker=null datum=<CollectingPipeFromChildToParentProcess read_fd=7 write_fd=8>> | |
[ERROR 2019-04-13 17:20:04 CEST] output on fd 1, stdout (0 lines): | |
[ERROR 2019-04-13 17:20:04 CEST] output on fd 2, stderr (0 lines): | |
[ERROR 2019-04-13 17:20:04 CEST] Frame 0: /Users/taazadi1/Downloads/ngs-0.2.6/lib/bootstrap.ngs:290:1 - 290:34 | |
[ERROR 2019-04-13 17:20:04 CEST] Frame 1: /Users/taazadi1/Downloads/ngs-0.2.6/lib/bootstrap.ngs:264:20 - 264:29 [in bootstrap_exception_catch_wrapper] | |
[ERROR 2019-04-13 17:20:04 CEST] Frame 2: /Users/taazadi1/Downloads/ngs-0.2.6/lib/bootstrap.ngs:201:11 - 201:23 [in bootstrap] | |
[ERROR 2019-04-13 17:20:04 CEST] Frame 3: /Users/taazadi1/Downloads/ngs-0.2.6/test.ngs:29:8 - 29:12 | |
[ERROR 2019-04-13 17:20:04 CEST] Frame 4: /Users/taazadi1/Downloads/ngs-0.2.6/lib/stdlib.ngs:1747:11 - 1747:13 [in each] | |
[ERROR 2019-04-13 17:20:04 CEST] Frame 5: /Users/taazadi1/Downloads/ngs-0.2.6/test.ngs:19:14 - 19:19 [in perform_tests_in_file] | |
[ERROR 2019-04-13 17:20:04 CEST] Frame 6: /Users/taazadi1/Downloads/ngs-0.2.6/lib/stdlib.ngs:4554:2 - 4554:9 [in lines] | |
[ERROR 2019-04-13 17:20:04 CEST] Frame 7: /Users/taazadi1/Downloads/ngs-0.2.6/lib/stdlib.ngs:1523:8 - 1523:14 [in finally] | |
[ERROR 2019-04-13 17:20:04 CEST] Frame 8: /Users/taazadi1/Downloads/ngs-0.2.6/lib/stdlib.ngs:3029:12 - 3029:15 [in Result] | |
[ERROR 2019-04-13 17:20:04 CEST] Frame 9: /Users/taazadi1/Downloads/ngs-0.2.6/lib/stdlib.ngs:4556:16 - 4556:21 | |
[ERROR 2019-04-13 17:20:04 CEST] Frame 10: /Users/taazadi1/Downloads/ngs-0.2.6/lib/stdlib.ngs:3594:11 - 3594:15 [in lines] | |
[ERROR 2019-04-13 17:20:04 CEST] Frame 11: /Users/taazadi1/Downloads/ngs-0.2.6/lib/stdlib.ngs:1747:11 - 1747:13 [in each] | |
[ERROR 2019-04-13 17:20:04 CEST] Frame 12: /Users/taazadi1/Downloads/ngs-0.2.6/test.ngs:22:5 - 22:17 | |
[ERROR 2019-04-13 17:20:04 CEST] Frame 13: /Users/taazadi1/Downloads/ngs-0.2.6/test.ngs:12:12 - 12:24 [in perform_test] | |
[ERROR 2019-04-13 17:20:04 CEST] Frame 14: <test>:1:3 - 1:3 | |
[ERROR 2019-04-13 17:20:04 CEST] Frame 15: <test>:1:11 - 1:11 | |
[ERROR 2019-04-13 17:20:04 CEST] Frame 16: /Users/taazadi1/Downloads/ngs-0.2.6/lib/stdlib.ngs:5181:6 - 5181:10 [in $()] | |
[ERROR 2019-04-13 17:20:04 CEST] Frame 17: /Users/taazadi1/Downloads/ngs-0.2.6/lib/stdlib.ngs:4870:15 - 4870:19 [in wait] | |
[ERROR 2019-04-13 17:20:04 CEST] Frame 18: /Users/taazadi1/Downloads/ngs-0.2.6/lib/stdlib.ngs:1747:11 - 1747:13 [in each] | |
[ERROR 2019-04-13 17:20:04 CEST] Frame 19: /Users/taazadi1/Downloads/ngs-0.2.6/lib/stdlib.ngs:4865:28 - 4865:35 [in wait] | |
+-------------------------------------------+ | |
| Executing external process 'false' failed | | |
| Command: false | | |
| Command exited with code: 1 | | |
+-------------------------------------------+ | |
+ Test: identity(10) == 10 | |
+ Test: p = partial((-), 10); p(7) == 3 | |
+ Test: p = partial_tail((-), 10); p(7) == -3 | |
+ Test: type T; t=T().set(a=1, b=2); t.a == 1 and t.b == 2 | |
+ Test: Pred({"a": Any})({"a": 1}) | |
+ Test: Pred({"a": Any, "b": Any})({"a": 1}) == false | |
+ Test: Pred({"a": Any, "b": {false}})({"a": 1, "b": 2}) == false | |
+ Test: Set([1,2]).mapo(X*2) == Set([2,4]) | |
+ Test: ["abc", 1, "def", 2].map(only(Int, X*2)) == ["abc", 2, "def", 4] | |
+ Test: partition([1,10,2,20], X>=10) == [[10, 20], [1, 2]] | |
+ Test: [1,2,3].first(X>1, 10) == 2 | |
+ Test: [1,2,3].first(X>5, 10) == 10 | |
+ Test: [1,2,3].first(X>1) == 2 | |
+ Test: try [1,2,3].first(X>5) catch(e:ElementNotFound) true | |
+ Test: [1,2,11,3,4].the_one(X>10) == 11 | |
+ Test: try [1,2,11,12,4].the_one(X>10) catch(e:ElementNotFound) true | |
+ Test: try [1,2,3,4].the_one(X>10) catch(e:ElementNotFound) true | |
+ Test: ok = false; [1,2,11,3,4].the_one(X>10, F(the_value) { if(the_value == 11) ok = true }); ok | |
+ Test: ok = false; [1,2,11,3,4].the_one(X>20, { does_not_matter }, found_none = { ok = true }); ok | |
+ Test: ok = false; [1,2,11,3,4].the_one(Int, { does_not_matter }, found_more = { ok = true }); ok | |
+ Test: [1,2,null,3].filter() == [1,2,3] | |
+ Test: [1,2,3,1,2].take(X<3) == [1,2] | |
+ Test: [1,2,3,1,2].drop(X<3) == [3,1,2] | |
+ Test: ["ssh", "IP", "w"].replace("IP", "10.0.0.100") == ['ssh','10.0.0.100','w'] | |
+ Test: [1,2,3].reduce(0, (+)) == 6 | |
+ Test: [10].reduce((+)) == 10 | |
+ Test: [1,2,3].reduce((+)) == 6 | |
+ Test: try [].reduce((+)) catch(e:EmptyEachableFail) true | |
+ Test: ok=false; (7.tap({ if A == 7 ok = true}) == 7) and ok | |
+ Test: ( 1 in [1,2,3].Iter()) == true | |
+ Test: (10 in [1,2,3].Iter()) == false | |
+ Test: a=[1,2]; a.push_all([3,4]); a==[1,2,3,4] | |
+ Test: Lines(["ab", "cd"]) + Lines(["ef"]) == Lines(["ab", "cd", "ef"]) | |
+ Test: Real('1.1') == 1.1 | |
+ Test: type T1; type T2(T1); T2() is T1 | |
+ Test: decode("no", Bool) == false | |
+ Test: decode("0", Bool) == false | |
+ Test: decode("yes", Bool) == true | |
+ Test: decode("1", Bool) == true | |
+ Test: decode("1", Int) == 1 | |
+ Test: decode("1", Real) == 1.0 | |
+ Test: Lines.is_subtype(Eachable1) | |
+ Test: Lines.is_subtype(Eachable) | |
+ Test: Int.is_subtype(Any) | |
+ Test: Eachable.is_subtype(Lines) == false | |
+ Test: type T; t=T(); Str(t) == '<T>' | |
+ Test: type T; t=T(); t.a=1; t.b=2; Str(t) == '<T a=1 b=2>' | |
+ Test: type T; t=T(); t.dflt("a", 1); t.a == 1 | |
+ Test: type T; t=T(); t.a = 2; t.dflt("a", 1); t.a == 2 | |
+ Test: [{}, {"x": 1}].dflt("x", 100) == [{"x": 100}, {"x": 1}] | |
+ Test: type T; t=T(); t.x=1; t2=t.copy(); t2.x==1 | |
+ Test: Lock().acquire(F() 1) == 1 | |
+ Test: 0..null is NumRange | |
+ Test: null..null is PredRange | |
+ Test: null.."xyz" is PredRange | |
+ Test: (1..3).map(X*2) == [2, 4] | |
+ Test: (1...3).map(X*2) == [2, 4, 6] | |
+ Test: (10..20).first(F(x) x % 3 == 0) == 12 | |
+ Test: not(1 in NumRange(1,2,false,true)) | |
+ Test: 2 in NumRange(1,2,false,true) | |
+ Test: not(10 in NumRange(1,2,false,true)) | |
+ Test: 20 in NumRange(1,30,false,true) | |
+ Test: 30 in NumRange(1,30,false,true) | |
+ Test: 1 != 2 | |
+ Test: (1 != 1) == false | |
+ Test: 1 !== 2 | |
+ Test: (1 !== 1) == false | |
+ Test: (1 not in [1,2,3]) == false | |
+ Test: 10 not in [1,2,3] | |
+ Test: 1 is not Null | |
+ Test: (null is not Null) == false | |
+ Test: [1,2,3].has(1) | |
+ Test: [1,2,3].has(10).not() | |
+ Test: (collector/"a" collect("b")) == "ab" | |
+ Test: a=0; {1/1}.finally({a=10}) == 1 and a == 10 | |
+ Test: a=0; (try finally() with {1/0} with {a=10} catch(e:DivisionByZero) "OK") == "OK" and a == 10 | |
+ Test: F f() { r=Return(); finally({throw r(7)}, {8}) }; f() == 7 | |
+ Test: %{k 7 kk "a"}.n() == {'k': 7, 'kk': 'a'} | |
+ Test: [{"x": 1}, {"x": 2}].x == [1, 2] | |
+ Test: a=[{"x": 1}, {"x": 2}]; a.y = 10; a == [{"x": 1, "y": 10}, {"x": 2, "y": 10}] | |
+ Test: "ab" + "cd" == "abcd" | |
+ Test: [1].get(0, 10) == 1 | |
+ Test: [1].get(5, 10) == 10 | |
+ Test: [1, 2] == [1, 2] | |
+ Test: [1, 3] != [1, 2] | |
+ Test: [1] != [1, 2] | |
+ Test: [1, 2] <= [1, 3] | |
+ Test: not([1, 3] <= [1, 2]) | |
+ Test: [1] <= [1, 2] | |
+ Test: not([1,2] <= [1]) | |
+ Test: [1,2,10].any(F(elt) elt > 5) | |
+ Test: [1,2,3].any(F(elt) elt > 5).not() | |
+ Test: [1,2,3].all(X<10) | |
+ Test: [1,2,10].all(X>5).not() | |
+ Test: {"x": 1, "y": 2}.all(F(k, v) v is Int) | |
+ Test: [0,1,2].none(X>2) | |
+ Test: [0,1,2].none(X<2).not() | |
+ Test: [1,2,3].map(X*4) == [4,8,12] | |
+ Test: [1,2,3].subset([1,2,3,4]) | |
+ Test: [1].subset([2]) == false | |
+ Test: r=[]; ["a", "b"].each_idx_val(F(idx, val) r.push([idx, val])); r == [[0, "a"], [1, "b"]] | |
+ Test: [1,2,3,2].without(2) == [1,3] | |
+ Test: [1,2,3] - [5,6,1] == [2,3] | |
+ Test: [1,2,3] - [5,6,1,1,1,1,1,1,1,1,1,1,1,2] == [3] | |
+ Test: [1,2,3,11,12].count(X>10) == 2 | |
+ Test: [0,1,2,null,false].count() == 2 | |
+ Test: [[1], [2,3]].flatten() == [1,2,3] | |
+ Test: [1,2,2,3,4,4].uniq() == [1,2,3,4] | |
+ Test: [null, false, 10, 20].first() == 10 | |
+ Test: [1,5,1,10].indexes(X>2) == [1,3] | |
+ Test: [5,10,15].first(X>7) == 10 | |
+ Test: try [5,10,15].first(X>20) catch(e:ElementNotFound) true | |
+ Test: [1,2,3].reverse() == [3,2,1] | |
+ Test: x=[1,2]; x.unshift(3); x == [3, 1, 2] | |
+ Test: Arr({'x': 7, 'y': 8}) == [['x', 7], ['y', 8]] | |
+ Test: zip([1,2,3], [4,5,6]) == [[1,4], [2,5], [3,6]] | |
+ Test: zip([1,2,3], [4,5,6], [7,8,9,10]) == [[1,4,7], [2,5,8], [3,6,9], [null, null, 10]] | |
+ Test: Arr(1..3) == [1,2] | |
+ Test: Arr(1...3) == [1,2,3] | |
+ Test: [10,20,30,40][1..-1] == [20,30] | |
+ Test: try { indexes([1,2,3,4], ((X==1)..(X==14))); false } catch(e:IndexNotFound) true | |
+ Test: indexes([1,2,3,4], ((X==1)..(X==14)), []) == [] | |
+ Test: %[a1 a2 b1 b2][/^a/../^b/] == %[a2] | |
+ Test: %[a1 a2 b1 b2][null../^b/] == %[a1 a2] | |
+ Test: %[a1 a2 b1 b2][/^b/..null] == %[b2] | |
+ Test: %[a1 a2 b1 b2][/^a/.../^b/] == %[a1 a2 b1] | |
+ Test: try { %[a1 a2 b1 b2][/^a/.../^x/]; false } catch(e:IndexNotFound) true | |
+ Test: try { %[a1 a2 b1 b2][/^x/.../^b/]; false } catch(e:IndexNotFound) true | |
+ Test: a = %[a1 a2 b1 b2]; a[/^a/.../^b/] = [7]; a == [7, 'b2'] | |
+ Test: a = %[a1 a2 b1 b2]; m = a ~ /^a/../^b/; m.matches == [['a2']] and m.before == ['a1'] and m.after == ['b1', 'b2'] | |
+ Test: a = %[a1 a2 b1 b2]; m = a ~ /^a/.../^b/; m.matches == [['a1','a2','b1']] and m.before == [] and m.after == ['b2'] | |
+ Test: [10,20,30,40][[0,3]] == [10, 40] | |
+ Test: [10,11,12].limit(10) == [10,11,12] | |
+ Test: [10,11,12].limit(2) == [10,11] | |
+ Test: [10,20] * 2 == [10,20,10,20] | |
+ Test: [10,20] * [30,40] == [[10, 30], [10, 40], [20, 30], [20, 40]] | |
+ Test: merge_sorted([1,3,10], [0, 7], (<=)) == [0, 1, 3, 7, 10] | |
+ Test: sort([0,5,3,-1], (<=)) == [-1, 0, 3, 5] | |
+ Test: [{'x': 1}, {'x': 5}, {'x': 3}].sort('x') == [{'x': 1}, {'x': 3}, {'x': 5}] | |
+ Test: [1, "a", 2, 3, "a", 4].split("a") == [[1], [2, 3], [4]] | |
+ Test: [1,2,3].intersperse(0) == [1,0,2,0,3] | |
+ Test: ensure_array([1,2]) == [1,2] | |
+ Test: ensure_array("aa") == ["aa"] | |
+ Test: subset({}, {"a": 1}) | |
+ Test: subset({"a": 1}, {"a": 1}) | |
+ Test: subset({"a": 1, "b":2}, {"b": 3, "d": 4}) == false | |
+ Test: subset({"a": 1}, {"a": 10}) == false | |
+ Test: {'a': 1, 'b': 2}.map(F(k, v) "${k}-$v") == ['a-1', 'b-2'] | |
+ Test: mapk({"a": 1}, X+"z") == {"az": 1} | |
+ Test: mapv({"a": 1}, X+1) == {"a": 2} | |
+ Test: mapkv({"a": 1}, {[A+"zz", B+10]}) == {"azz": 11} | |
+ Test: {'a': 1, 'b': 2}.filter(F(k, v) k == 'a') == {'a': 1} | |
+ Test: {"a1": 1, "a2": 2, "b1": 10}.filterk(/^b/) == {"b1": 10} | |
+ Test: {"a1": 1, "a2": 2, "b1": 10}.rejectk(/^b/) == {"a1": 1, "a2": 2} | |
+ Test: {"a1": 1, "a2": 2, "b1": 10}.filterv(X>5) == {"b1": 10} | |
+ Test: {"a1": 1, "a2": 2, "b1": 10}.rejectv(X>5) == {"a1": 1, "a2": 2} | |
+ Test: {'a': 1, 'b': 2, 'c': 11}.count(F(k, v) v>10) == 1 | |
+ Test: {'b': 2, 'c': 11, 'a': 1}.sortk() == {'a': 1, 'b': 2, 'c': 11} | |
+ Test: {'a': 1, 'b': 2, 'c': 11}.sortk() == {'a': 1, 'b': 2, 'c': 11} | |
+ Test: Hash([['a', 1], ['c', 3]]) == {'a': 1, 'c': 3} | |
+ Test: Hash([{'x': 1}, {'x': 2}], 'x') == {1: {'x': 1}, 2: {'x': 2}} | |
+ Test: Hash([1,2], F(x) x*2) == {1: 2, 2: 4} | |
+ Test: Hash(["a", "b", "c"], [1,2,3]) == {"a": 1, "b": 2, "c": 3} | |
+ Test: Hash([{"Name": "n1", "Value": "v1"},{"Name": "n2", "Value": "v2"}], "Name", "Value") == {"n1": "v1", "n2": "v2"} | |
+ Test: {'a': 1, 'b': 2, 'c': 3}.without('a') == {'b': 2, 'c': 3} | |
+ Test: {'a': 1, 'b': 2, 'c': 3}.without('a', 1).without('b', 22) == {'b': 2, 'c': 3} | |
+ Test: {'a': 1, 'b': 2, 'c': 3} + {'b': 20, 'd': 40} == {'a': 1, 'b': 20, 'c': 3, 'd': 40} | |
+ Test: {'a': 1, 'b': 2}.Strs() == ['a=1', 'b=2'] | |
+ Test: {"a": 1, "b": 2}.limit(3) == {"a": 1, "b": 2} | |
+ Test: {"a": 1, "b": 2}.limit(1) == {"a": 1} | |
+ Test: h={"a": 1}; g=copy(h); h.b = 2; ("b" in h) and ("b" not in g) | |
+ Test: {"b": 2, "c": 3, "a": 1}.sort() == {"a": 1, "b": 2, "c": 3} | |
+ Test: h={"a": 1}; s = h.shift("a"); h == {} and s == 1 | |
+ Test: h={}; try h.shift("a") catch(e:KeyNotFound) true | |
+ Test: h={}; h.shift("a", 7) == 7 | |
+ Test: h={"a": 1, "b": 2}; s = h.shift("a"); h == {"b": 2} and s == 1 | |
+ Test: Box(5).any(Int) | |
+ Test: EmptyBox().any(Str) == false | |
+ Test: EmptyBox().any(Int) == false | |
+ Test: Box(5).none(Int) == false | |
+ Test: Box(5).none(Str) | |
+ Test: EmptyBox().none(Int) | |
+ Test: try EmptyBox().get() catch(e:BoxFail) true | |
+ Test: EmptyBox().get(10) == 10 | |
+ Test: Box().get(10) == 10 | |
+ Test: Box() == EmptyBox() | |
+ Test: Box(null) == EmptyBox() | |
+ Test: EmptyBox() == EmptyBox() | |
+ Test: EmptyBox() != FullBox(1) | |
+ Test: FullBox(1) == FullBox(1) | |
+ Test: FullBox(1) != FullBox(2) | |
+ Test: {read("/etc/passwd")}.Result() is Success | |
+ Test: {read("NO-SUCH-FILE")}.Result() is Failure | |
+ Test: Success(10).map(X*2).get() == 20 | |
+ Test: try ({ throw Error("xx") }.Result().map(X*2).get()) catch(rf:ResultFail) true | |
+ Test: Diff([1,2], [2,3]).Hash().sort() == {'add': [3], 'remove': [1]} | |
+ Test: Diff(["a", "b"], [Present("a"), Present("c"), Absent("b"), Absent("d")], false).Hash().sort() == {"add": ["c"], "remove": ["b"]} | |
+ Test: Diff(["a", "b"], [Present("a"), Present("c"), Absent("b"), Absent("d")], true).Hash().sort() == {"add": ["c"], "remove": ["b"]} | |
+ Test: Diff({"a": 1, "b":2}, {"b": 3, "d": 4}).Hash().sort() == {"add":{"d":4}, "change":{"b":3}, "remove":["a"]} | |
+ Test: 3.map(identity) == [0, 1, 2] | |
+ Test: 3.map(X*3) == [0, 3, 6] | |
+ Test: r=0; 5.times(F() r=r+2); r==10 | |
+ Test: Int(" 100 ") == 100 | |
+ Test: try Int(" XX ") catch(e:InvalidArgument) true | |
+ Test: Int(" XX ", 36) == 1221 | |
+ Test: true.Int() == 1 | |
+ Test: false.Int() == 0 | |
+ Test: pos("abc", "cd") == null | |
+ Test: pos("abcdef", "cd") == 2 | |
+ Test: pos("a:b:c", ":") == 1 | |
+ Test: pos("a:b:c", ":", 2) == 3 | |
+ Test: "bc" in "abcd" | |
+ Test: "x" not in "abcd" | |
+ Test: ("abc"[0] == "a") and ("abc"[2] == "c") | |
+ Test: try "abc"[3] == "x" catch(e:IndexNotFound) true | |
+ Test: ("abc"[-1] == "c") and ("abc"[-3] == "a") | |
+ Test: try "abc"[-4] == "x" catch(e:IndexNotFound) true | |
+ Test: ":a:bc:d:".split(":") == ["", "a", "bc", "d", ""] | |
+ Test: "bucket_name/dir/file".split("/", 2) == ["bucket_name", "dir/file"] | |
+ Test: ":a:bc:d:".split("bc") == [":a:", ":d:"] | |
+ Test: Str(10, 4) == ' 10' | |
+ Test: Str(10, 4, '0') == '0010' | |
+ Test: Str(10, -4) == '10 ' | |
+ Test: Str('x', 3) == 'x ' | |
+ Test: Str('x',-3) == ' x' | |
+ Test: Str('x',-3, '.') == '..x' | |
+ Test: "abcd".starts_with("ab") | |
+ Test: "ab".starts_with("abcd") == false | |
+ Test: "abcd".ends_with("cd") | |
+ Test: "ab".ends_with("cdab") == false | |
+ Test: "xx\nyy".lines() == %[xx yy] | |
+ Test: "a " + ["1", "2"] == ["a 1", "a 2"] | |
+ Test: ["1", "2"] + " a" == ["1 a", "2 a"] | |
+ Test: "abcd".mapo(F(x) if x == "b" then "X" else x) == "aXcd" | |
+ Test: "abc".limit(5, "...") == "abc" | |
+ Test: "abcdef".limit(5, "...") == "ab..." | |
+ Test: "abcdef".limit(2) == "ab" | |
+ Test: m = (~~)("abcbe", "b", true); m.len() == 5 and m[[0,2,4]] == %[a c e] and m[[1,3]].all(MatchSuccess) | |
+ Test: "x10ab20c30y".replace("0", "X") == "x1Xab2Xc3Xy" | |
+ Test: "a$*{[1,2]}b$*{10..12}c" == ["a1b10c", "a1b11c", "a2b10c", "a2b11c"] | |
+ Test: Stats().push('a').push('a').push('b').Hash() == {'a': 2, 'b': 1} | |
+ Test: Stats(['a', 'a', 'b']).Hash() == {'a': 2, 'b': 1} | |
+ Test: Stats(['a', 'a', 'b'])['a'] == 2 | |
+ Test: Stats(['a', 'a', 'b']).a == 2 | |
+ Test: (1..3).Arr().pmap(X*10) == [10, 20] | |
+ Test: 3.pmap(X*10) == [0, 10, 20] | |
+ Test: Path('/').Bool() | |
+ Test: Path('/no-such-file').Bool() == false | |
+ Test: Path('/', true) is Dir | |
+ Test: dir("/").path.has("/var") | |
+ Test: dir("/").all({A.typeof().name == 'Path'}) | |
+ Test: dir("/", subtype=true).all({ (A is Path) and (A.typeof().name != 'Path') }) | |
+ Test: File('xy').Str() == '<File path=xy fd=null>' | |
+ Test: open(File("/etc/passwd"), "r").fd > 0 | |
+ Test: ok = false; File("/etc/passwd").lines({if ":" in A ok = true}); ok | |
+ Test: try $(ok:2 cat NO_SUCH_FILE 2>/dev/null) catch(pf:ProcessFail) true | |
+ Test: $(ok:1 cat NO_SUCH_FILE 2>/dev/null); true | |
+ Test: $(ok:[1,10] cat NO_SUCH_FILE 2>/dev/null); true | |
+ Test: $(ok:1..2 cat NO_SUCH_FILE 2>/dev/null); true | |
+ Test: p=$(sleep 10 &); p.kill(); try p.wait() catch(pf:ProcessFail) true | |
+ Test: p=$(ok_sig:SIGNALS.TERM sleep 10 &); p.kill(); p.wait(); true | |
+ Test: Argv({"--a": 1, "-b": null, ["-y1", "-n1"]: true, ["-y2", "-n2"]: false, ["-y3"]: true, ["-y4"]: false}) == ["--a", 1, "-y1", "-n2", "-y3"] | |
+ Test: Argv({"-a1": [], "-a2": [1,2,3]}) == ["-a2", 1, 2, 3] | |
+ Test: Argv({["--repeat"]: ["a", "b"]}) == ["--repeat", "a", "--repeat", "b"] | |
+ Test: $(true).Bool() | |
+ Test: $(false).Bool() == false | |
<end of output> | |
Test time = 0.96 sec | |
---------------------------------------------------------- | |
Test Failed. | |
"all" end time: Apr 13 17:20 CEST | |
"all" time elapsed: 00:00:00 | |
---------------------------------------------------------- | |
End testing: Apr 13 17:20 CEST |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment