diff options
Diffstat (limited to 'web-client-with-cache.org')
-rw-r--r-- | web-client-with-cache.org | 44 |
1 files changed, 37 insertions, 7 deletions
diff --git a/web-client-with-cache.org b/web-client-with-cache.org index 6e89072..eed7a8d 100644 --- a/web-client-with-cache.org +++ b/web-client-with-cache.org @@ -57,9 +57,9 @@ looks like this: #+begin_src scheme :eval no (cons (channel - (name 'web-client-with-cache) - (url "https://labo.planete-kraus.eu/web-client-with-cache.git")) - %default-channels) + (name 'web-client-with-cache) + (url "https://labo.planete-kraus.eu/web-client-with-cache.git")) + %default-channels) #+end_src Then, run guix pull: @@ -597,9 +597,6 @@ The final function is [[fn-with-cache]]. It takes its docstring from <<fn-with-cache-query>> (lambda (uri . args) (apply with-cache-query box (current-time) smart-http-get http-get uri args)))) - - (define-public (run-tests) - <<tests>>) #+end_src * Test cases @@ -921,13 +918,46 @@ Let's see immediately an example, program [[test-1]]. ** All the tests :noexport: #+name: tests -#+begin_src scheme :eval no :noweb yes +#+begin_src scheme :eval no :noweb yes :tangle tests/tests.scm :mkdirp t + (define-module (tests-harness) + #:use-module (web client with-cache) + #:use-module (web response) + #:use-module (ice-9 atomic) + #:use-module (ice-9 receive) + #:use-module (srfi srfi-19) + #:use-module (srfi srfi-64) + #:use-module (srfi srfi-69)) + + (module-define! (resolve-module '(srfi srfi-64)) + 'test-log-to-file #f) + <<fn-run-test-case>> + + (test-begin "test-1") + <<test-1>> + + (test-end "test-1") + (test-begin "test-2") + <<test-2>> + + (test-end "test-2") + (test-begin "test-3") + <<test-3>> + + (test-end "test-3") + (test-begin "test-4") + <<test-4>> + + (test-end "test-4") + (test-begin "test-5") + <<test-5>> + + (test-end "test-5") #+end_src * GNU Free Documentation License :PROPERTIES: |