Annotation of parser3/tests/346-curl.html, revision 1.7

1.3       moko        1: @main[]
                      2: 
1.6       moko        3: 1. ^try-catch{ ^curl:info[] }
                      4: 2. ^try-catch{ ^curl:options[ $.charset[UTF-8] ] }
                      5: 3. ^try-catch{ ^curl:options[ $.url[http://parser.ru/] ] }
1.2       moko        6: 
1.6       moko        7: 4. ^curl:session{ $s[^curl:version[]] }
1.2       moko        8: 
1.6       moko        9: 5. ^try-catch{ ^curl:options[ $.library[no-such-library.so] ] }
1.2       moko       10: 
1.1       moko       11: ^curl:session{
1.6       moko       12:        6. ^try-catch{ ^curl:options[ $.url[ftp://parser.ru/] ] }
                     13:        7. ^try-catch{ ^curl:options[ $.httppost[ $.name[ $.hash[] ]] ] }
                     14:        8. ^try-catch{ ^curl:options[ $.httppost[string] ] }
1.7     ! moko       15:        8.1. ^try-catch{ ^curl:options[ $.httppost{code} ] }
        !            16: 
        !            17:        8.2. ^try-catch{ ^curl:options[ $.httpheader[string] ] }
        !            18:        8.3. ^try-catch{ ^curl:options[ $.httpheader{code} ] }
        !            19:        8.4. ^try-catch{ ^curl:options[ $.httpheader{  } ] }
        !            20: 
1.6       moko       21:        9. ^try-catch{ ^curl:options[ $.no-such-option[] ] }
                     22:        10. ^try-catch{ ^curl:info[no-such-info] }
                     23:        11. ^json:string[^curl:info[]]
1.3       moko       24: 
                     25:        ^curl:options[
                     26:                $.url[http://www.parser.ru/_/tests/readme]
                     27:                $.timeout(5)
                     28:        ]
                     29: 
1.6       moko       30:        12. $f[^curl:load[
1.3       moko       31:                $.range[4-] 
                     32:        ]]
                     33: 
                     34:        $f.text $f.CONTENT-RANGE
                     35: 
1.6       moko       36:        13. $f[^curl:load[
1.3       moko       37:                $.range[33-]
                     38:        ]]
                     39: 
                     40:        $f.text $f.CONTENT-RANGE
                     41: }
                     42: 
1.6       moko       43: 14. ^show[text;
1.3       moko       44:        $.postfields[test]
                     45:        $.useragent[^taint[parser 3]]
                     46: 
                     47:        $.name[test.txt]
                     48:        $.mode[binary]
                     49:        $.content-type[something/text]
1.4       moko       50: ]
1.3       moko       51: 
1.6       moko       52: 15. ^show[binary;
1.3       moko       53:        $.postfields[^file::load[binary;155.cfg]]
1.4       moko       54: ]
                     55: 
1.6       moko       56: 16. ^show[empty post;
1.4       moko       57:        $.httppost[]
                     58: ]
1.3       moko       59: 
1.6       moko       60: 17. ^try-catch{ ^curl:load[ $.url[http://no-such-domain.parser.ru/] ] }
1.3       moko       61: 
1.5       moko       62: @show[title;options][f;text;t;post]
1.4       moko       63: 
                     64: $f[^curl:load[
                     65:        $options
                     66:        $.timeout(5)
                     67:        $.url[http://www.parser.ru/_/tests/223.pl]
                     68: ]]
                     69: 
1.3       moko       70: $title : {
                     71: "name":"$f.name",
                     72: "size":$f.size,
                     73: "mode":"$f.mode",
                     74: "content-type":"^taint[json;$f.content-type]",
1.1       moko       75: }
1.3       moko       76: 
                     77: $text[^taint[as-is][$f.text]]
                     78: # cut off the post's body is any
                     79: $text[^text.match[POST:(.*)<EOF>][]{$post[$match.1]}]
                     80: 
                     81: # create table with http headers
                     82: $t[^table::create[nameless]{^taint[as-is][^text.replace[^table::create{a       b
                     83:  =     ^taint[^#09]
                     84: ^taint[^#0A]   ^taint[^#0A]}]]}]
                     85: ^t.sort{$t.0}
                     86: 
                     87: # print all
                     88: <h3>Headers</h3>
                     89: <pre>^t.menu{$t.0      : $t.1}[^#0A]</pre>
                     90: 
                     91: <h3>Body</h3>
                     92: <pre>^taint[as-is][$post]</pre>
                     93: <hr />

E-mail: