Mercurial > urweb
annotate tests/cffi.ur @ 834:74e9e7642f08
Do 'open constraints' automatically; fix sourceless <cselect> monoize bug; Monad library module
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 02 Jun 2009 11:50:53 -0400 |
parents | eac1974924bb |
children |
rev | line source |
---|---|
adamc@766 | 1 fun printer () = Test.foo |
adamc@766 | 2 |
adamc@765 | 3 fun effect () = |
adamc@765 | 4 Test.print; |
adamc@766 | 5 return <xml><body> |
adamc@766 | 6 <button value="Remote" onclick={printer ()}/> |
adamc@766 | 7 <button value="Local" onclick={Test.bar "Hoho"}/> |
adamc@766 | 8 <button value="Either" onclick={Test.print}/> |
adamc@766 | 9 </body></xml> |
adamc@765 | 10 |
adamc@771 | 11 fun xact () = |
adamc@771 | 12 Test.transactional; |
adamc@771 | 13 return <xml><body> |
adamc@771 | 14 All good. |
adamc@771 | 15 </body></xml> |
adamc@771 | 16 |
adamc@771 | 17 fun xact2 () = |
adamc@771 | 18 Test.transactional; |
adamc@771 | 19 error <xml>Failure</xml>; |
adamc@771 | 20 return <xml><body> |
adamc@771 | 21 All gooder. |
adamc@771 | 22 </body></xml> |
adamc@771 | 23 |
adamc@764 | 24 fun main () = return <xml><body> |
adamc@764 | 25 {[Test.out (Test.frob (Test.create "Hello ") "world!")]} |
adamc@765 | 26 <form><submit action={effect}/></form> |
adamc@771 | 27 <form><submit action={xact}/></form> |
adamc@771 | 28 <form><submit action={xact2}/></form> |
adamc@764 | 29 </body></xml> |