Annotation of parser3/tests/407.html, revision 1.2
1.1 moko 1: # based on ^table:select[] test in 262.html
2:
3: $log[^table::create{cpu url
4: 0.2200 /novosibirsk/retail/
5: 0.1600 /nizhninovgorod/
6: 0.0200 /_/rss/_rss.html
7: 0.2233 /retail/credit/.../
8: 0.0000 /_goto.html
9: 0.1500 /sme/accounts/software/
10: 0.1700 /ufa/
11: 0.0100 /address/
12: 0.1367 /omsk/atm/omsk/.../
13: 0.1833 /sochi/retail/cards/.../
14: 0.0033 /
15: 0.1533 /corporate/loans/
16: 0.0100 /retail/
17: 0.0033 /peterburg/
18: 0.1533 /perm/
19: }]
20:
21: $log[^log.hash[url;cpu; $.type[string] ]]
22:
23: Hit:
24: $hit[^log.select[;cpu]($cpu<0.05)]
25: ^hit.foreach[url;]{$url}[^#0A]
26:
27: Limit:
28: $hit[^log.select[;cpu]($cpu<0.05)[ $.limit(2) ]]
29: ^hit.foreach[url;]{$url}[^#0A]
30:
31: $hit[^log.select[;cpu]($cpu<0.05)[ $.limit(-1) ]]
32: ^hit.foreach[url;]{$url}[^#0A]
33:
34: Short:
35: $short[^log.select[url;](^url.length[]<7)]
36: ^short.foreach[url;]{$url}[^#0A]
37:
38: Reverse test:
1.2 ! moko 39: $h[^hash::create[$log] $._default[-]]
! 40: default before: $h.404
! 41: $h[^h.reverse[]]
! 42: default after: $h.404
! 43: ^json:string[$h]
1.1 moko 44:
45: Hit:
46: $hit[^log.select[;cpu]($cpu<0.05)[ $.reverse(true) ]]
47: ^hit.foreach[url;]{$url}[^#0A]
48:
49: Limit:
50: $hit[^log.select[;cpu]($cpu<0.05)[ $.limit(2) $.reverse(true) ]]
51: ^hit.foreach[url;]{$url}[^#0A]
52:
53: Short:
54: $short[^log.select[url;](^url.length[]<7)[ $.reverse(true) ]]
55: ^short.foreach[url;]{$url}[^#0A]
E-mail: