aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2020-02-03 15:57:43 +0800
committerLi Jin <dragon-fly@qq.com>2020-02-03 15:57:43 +0800
commit2e50c15bfe67d4709880a0377d37fca191be2f3e (patch)
tree9b687d410ec88d402ebabdc9ddba6c12602cec36
parentd75848152e337fc9d3a4041ec310fea07476c0a8 (diff)
downloadyuescript-2e50c15bfe67d4709880a0377d37fca191be2f3e.tar.gz
yuescript-2e50c15bfe67d4709880a0377d37fca191be2f3e.tar.bz2
yuescript-2e50c15bfe67d4709880a0377d37fca191be2f3e.zip
add specs.
-rw-r--r--spec/inputs/backcall.moon16
1 files changed, 11 insertions, 5 deletions
diff --git a/spec/inputs/backcall.moon b/spec/inputs/backcall.moon
index c52fee3..a65bb0a 100644
--- a/spec/inputs/backcall.moon
+++ b/spec/inputs/backcall.moon
@@ -31,6 +31,10 @@ f = ->
31998 |> func0("abc", 233) |> func1 |> func2 31998 |> func0("abc", 233) |> func1 |> func2
32 32
33do 33do
34 (x)<-map {1,2,3}
35 x * 2
36
37do
34 (data)<- http?.get "ajaxtest" 38 (data)<- http?.get "ajaxtest"
35 body[".result"]\html data 39 body[".result"]\html data
36 (processed)<- http.post "ajaxprocess", data 40 (processed)<- http.post "ajaxprocess", data
@@ -44,7 +48,7 @@ do
44 if err 48 if err
45 print err 49 print err
46 return 50 return
47 (codes) <- compileAsync data 51 (codes)<- compileAsync data
48 func = loadstring codes 52 func = loadstring codes
49 func! 53 func!
50 54
@@ -59,13 +63,15 @@ do
59 f7! 63 f7!
60 64
61do 65do
62 result = do 66 {:result,:msg} = do
63 (data)<- loadAsync "filename.txt" 67 (data)<- receiveAsync "filename.txt"
64 print data 68 print data
65 print result 69 (info)<- processAsync data
70 check info
71 print result,msg
66 72
67 totalSize = (for file in *files 73 totalSize = (for file in *files
68 (data)<-loadAsync file 74 (data)<- loadAsync file
69 addToCache file,data) |> reduce 0,(a,b)-> a+b 75 addToCache file,data) |> reduce 0,(a,b)-> a+b
70 76
71alert "hi" 77alert "hi"