more tests, file extension to .lsp
This commit is contained in:
parent
af50184a17
commit
27a0aaba3f
|
|
@ -2,6 +2,19 @@
|
||||||
|
|
||||||
(print "Test starts")
|
(print "Test starts")
|
||||||
|
|
||||||
|
(print "result of (and (> 2 1) (> 2 1)): " (and (> 2 1) (> 2 1)))
|
||||||
|
(print "result of (or (> 2 1) (> 2 1)): " (or (> 2 1) (> 2 1)))
|
||||||
|
(print "result of (and (> 2 1) (> 1 2)): " (and (> 2 1) (> 1 2)))
|
||||||
|
(print "result of (or (> 2 1) (> 1 2)): " (or (> 2 1) (> 1 2)))
|
||||||
|
(print "result of (and (> 1 1) (> 1 2)): " (and (> 1 1) (> 1 2)))
|
||||||
|
(print "result of (or (> 1 1) (> 2 1)): " (or (> 1 1) (> 1 2)))
|
||||||
|
|
||||||
|
|
||||||
|
(print "(member '(1 2 3) 1:" (member '(1 2 3) 1))
|
||||||
|
(print "(member '(1 2 3) 3:" (member '(1 2 3) 3))
|
||||||
|
(print "(member '(1 2 3) 30:" (member '(1 2 3) 30))
|
||||||
|
|
||||||
|
|
||||||
(defun fact (n)
|
(defun fact (n)
|
||||||
(if (<= n 1)
|
(if (<= n 1)
|
||||||
1
|
1
|
||||||
|
|
@ -24,8 +37,7 @@
|
||||||
|
|
||||||
(define json_list (parse-json "{\"k1\":\"v1\", \"k2\":42, \"k3\":[\"a\",123,true,false,null]}"))
|
(define json_list (parse-json "{\"k1\":\"v1\", \"k2\":42, \"k3\":[\"a\",123,true,false,null]}"))
|
||||||
(print json_list)
|
(print json_list)
|
||||||
(for x json_list
|
(for x json_list (print x))
|
||||||
(print x))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -47,7 +59,7 @@
|
||||||
; (write-file "tests/csv_data.csv" (last web_page))
|
; (write-file "tests/csv_data.csv" (last web_page))
|
||||||
|
|
||||||
(define fdx_list (parse-csv (read-file "tests/csv_data.csv")))
|
(define fdx_list (parse-csv (read-file "tests/csv_data.csv")))
|
||||||
(print fdx_list)
|
; (print fdx_list)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -106,6 +118,10 @@
|
||||||
(if (> 2 10)
|
(if (> 2 10)
|
||||||
(print "2 > 10"))
|
(print "2 > 10"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(define csv_list '())
|
(define csv_list '())
|
||||||
(for f (ls-dir "tests/divi")
|
(for f (ls-dir "tests/divi")
|
||||||
(if (regex-search? f "^divi.*\.csv$")
|
(if (regex-search? f "^divi.*\.csv$")
|
||||||
|
|
@ -118,10 +134,15 @@
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
;; (for x csv_list
|
;; (for x csv_list (print x))
|
||||||
;; (print x))
|
|
||||||
|
(print "(len csv_list) : " (len csv_list))
|
||||||
|
|
||||||
|
(define my_tickers '("WFC" "AIG"))
|
||||||
|
|
||||||
|
; (print (filter (lambda (x) (= (first x) "CLX")) csv_list))
|
||||||
|
(print (filter (lambda (x) (member my_tickers (first x))) csv_list))
|
||||||
|
|
||||||
(print (len csv_list))
|
|
||||||
|
|
||||||
|
|
||||||
(print "Test ends")
|
(print "Test ends")
|
||||||
Loading…
Reference in New Issue