Mercurial > hg > jgplsrc
comparison test/g421d.ijs @ 0:e0bbaa717f41 draft default tip
lol J
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Mon, 25 Nov 2013 11:56:30 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e0bbaa717f41 |
---|---|
1 NB. x ({.,#)/. y and x (#,{.)/.y ---------------------------------------- | |
2 | |
3 f=: ~:@[ # ] | |
4 g=: #/. | |
5 | |
6 test=: 3 : 0 | |
7 y testa 0 1 | |
8 y testa i.900 | |
9 y testa _450+i.900 | |
10 y testa o. i.900 | |
11 y testa x: i.900 | |
12 ) | |
13 | |
14 testa=: 4 : 0 | |
15 yy=:y{~?1000$#y | |
16 assert. xx (({.,#)/. -: (f,.g)) yy [ xx=:x{~?1000$#x | |
17 assert. xx ((#,{.)/. -: (g,.f)) yy | |
18 if. 1:@:>: :: 0: x do. | |
19 assert. xx (({.,#)/. -: (f,.g)) xx | |
20 assert. xx ((#,{.)/. -: (g,.f)) xx | |
21 end. | |
22 assert. xx (({.,#)/. -: (f,.g)) yy [ xx=:x{~ 1000$0 | |
23 assert. xx ((#,{.)/. -: (g,.f)) yy | |
24 if. 1:@:>: :: 0: x do. | |
25 assert. xx (({.,#)/. -: (f,.g)) xx | |
26 assert. xx ((#,{.)/. -: (g,.f)) xx | |
27 assert. xx (({.,#)/. -: (f,.g)) xx=: ''($,)x | |
28 assert. xx ((#,{.)/. -: (g,.f)) xx | |
29 end. | |
30 1 | |
31 ) | |
32 | |
33 test 0 1 | |
34 test 1 0 | |
35 test a. | |
36 test i.900 | |
37 test _450+i.900 | |
38 test 1e6+i.900 | |
39 test _1e6+i.900 | |
40 test u: 100 ?@$ 65536 | |
41 test o.i.900 | |
42 test o._450+i.900 | |
43 test <"0 ?40$100 | |
44 | |
45 | |
46 'domain error' -: 1 2 3 ({.,#)/. etx 'abc' | |
47 'domain error' -: 1 2 3 ({.,#)/. etx ;:'foo upon thee' | |
48 | |
49 | |
50 4!:55 ;:'f g test testa xx yy' | |
51 | |
52 |