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

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
1.9       moko       41: 
                     42:        13.1. ^try-catch{ ^curl:options[ $.http_version[unknown] ] }
                     43:        13.2. ^try-catch{ ^curl:options[ $.http_version[1.0] ] }
1.3       moko       44: }
                     45: 
1.6       moko       46: 14. ^show[text;
1.3       moko       47:        $.postfields[test]
                     48:        $.useragent[^taint[parser 3]]
                     49: 
                     50:        $.name[test.txt]
                     51:        $.mode[binary]
                     52:        $.content-type[something/text]
1.4       moko       53: ]
1.3       moko       54: 
1.6       moko       55: 15. ^show[binary;
1.3       moko       56:        $.postfields[^file::load[binary;155.cfg]]
1.4       moko       57: ]
                     58: 
1.8       moko       59: ^curl:session{
                     60: 
1.6       moko       61: 16. ^show[empty post;
1.8       moko       62:        $.post(true)
                     63: ]
                     64: 
                     65: 17. ^show[empty get;
1.4       moko       66:        $.httppost[]
1.8       moko       67:        $.post(false)
                     68: ]
                     69: 
                     70: }
                     71: 
                     72: 18. ^show[empty custompost;
                     73:        $.customrequest[POST]
1.4       moko       74: ]
1.3       moko       75: 
1.10      moko       76: 19. ^try-catch-filtered{ ^curl:load[ $.url[http://no-such-domain.parser.ru/] ] }
1.3       moko       77: 
1.11    ! moko       78: @show[title;options]
        !            79: ^try-catch{^show-real[$title;$options]}
        !            80: 
        !            81: @show-real[title;options][f;text;t;post]
1.4       moko       82: 
                     83: $f[^curl:load[
                     84:        $options
                     85:        $.timeout(5)
                     86:        $.url[http://www.parser.ru/_/tests/223.pl]
                     87: ]]
                     88: 
1.3       moko       89: $title : {
                     90: "name":"$f.name",
                     91: "size":$f.size,
                     92: "mode":"$f.mode",
                     93: "content-type":"^taint[json;$f.content-type]",
1.1       moko       94: }
1.3       moko       95: 
                     96: $text[^taint[as-is][$f.text]]
                     97: # cut off the post's body is any
                     98: $text[^text.match[POST:(.*)<EOF>][]{$post[$match.1]}]
                     99: 
                    100: # create table with http headers
                    101: $t[^table::create[nameless]{^taint[as-is][^text.replace[^table::create{a       b
                    102:  =     ^taint[^#09]
                    103: ^taint[^#0A]   ^taint[^#0A]}]]}]
                    104: ^t.sort{$t.0}
                    105: 
                    106: # print all
                    107: <h3>Headers</h3>
                    108: <pre>^t.menu{$t.0      : $t.1}[^#0A]</pre>
                    109: 
                    110: <h3>Body</h3>
                    111: <pre>^taint[as-is][$post]</pre>
                    112: <hr />

E-mail: