From a39e61a061dfd7c104f157780132fbf3ce5b5d3b Mon Sep 17 00:00:00 2001 From: VaclavT Date: Wed, 17 Feb 2021 23:01:54 +0100 Subject: [PATCH] test added --- Readme.md | 4 ++++ debug.lisp | 9 +-------- tests/test.lisp | 12 +++++++++++- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Readme.md b/Readme.md index 353d24b..3eb1ec3 100644 --- a/Readme.md +++ b/Readme.md @@ -58,3 +58,7 @@ https://baptiste-wicht.com/posts/2012/12/cpp-benchmark-vector-list-deque.html ``` https://stackoverflow.com/questions/25896916/parse-http-headers-in-c + + +#### read stdout and stderr from popen +https://stackoverflow.com/questions/478898/how-do-i-execute-a-command-and-get-the-output-of-the-command-within-c-using-po \ No newline at end of file diff --git a/debug.lisp b/debug.lisp index f026b14..fa8b5be 100644 --- a/debug.lisp +++ b/debug.lisp @@ -1,16 +1,9 @@ (print "Debug starts") -; nefunguje - api.nasdaq.com -;(define nasdaq_headers (quote (("Accept" "application/json, text/plain, */*") ("Connection" "keep-alive") ("Origin" "https://www.nasdaq.com/") ("User-Agent" "Mozilla/5.0 (Windows NT 10.0)")))) -;(define json_list2 (parse-json (read-url "https://api.nasdaq.com/api/calendar/dividends/?date=2021-02-01" nasdaq_headers))) -; (for x json_list2 -; (print x)) +; (print (make-csv '(("r1c1" "r1c2") ("r2c1" "r2c2")))) -(print (make-csv '(("r1c1" "r1c2") ("r2c1" "r2c2")))) - - (print "Debug ends") diff --git a/tests/test.lisp b/tests/test.lisp index 6781760..b7ac53f 100644 --- a/tests/test.lisp +++ b/tests/test.lisp @@ -8,7 +8,17 @@ (* n (fact (- n 1))) )) -(print (fact 1000)) +(print (fact 5)) + +; for this stack must be 16MB, otherwise 1000 is ok +(defun scitej (n) + (if (<= n 1) + 1 + (+ n (scitej + (- n 1))) + )) + +(print (scitej 4000))