Changeset 22169 in project for release/4/isbn/trunk/tests/run.scm


Ignore:
Timestamp:
01/02/11 22:03:32 (10 years ago)
Author:
Christian Kellermann
Message:

isbn: welcome the openlibrary api

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/isbn/trunk/tests/run.scm

    r22163 r22169  
    33(include "../isbn.scm")
    44(import isbn)
     5(include "../openlibrary.scm")
     6(import openlibrary)
     7
    58
    69(test-group "ISBN-10"
     
    3437            (test "Normalize ISBN-10 (with 10 check digit)"
    3538                  "052103311X" (normalize-isbn "0-521-03311-X")))
     39
     40(define literate-programming
     41  '((title . "Literate programming")
     42    (authors ("Donald Knuth"))
     43    (publisher ("Center for the Study of Language and Information"))
     44    (publishing-date . "1992")
     45    (number-of-pages . 368)
     46    (cover-urls
     47     ("small" . "http://covers.openlibrary.org/b/id/715228-S.jpg")
     48     ("large" . "http://covers.openlibrary.org/b/id/715228-L.jpg")
     49     ("medium" . "http://covers.openlibrary.org/b/id/715228-M.jpg"))
     50    (isbn-numbers (("0937073806" "0937073814")))))
     51
     52(define literate-programming-simplified
     53  '((title . "Literate programming")
     54    (authors ("Donald Knuth"))
     55    (publishing-date . "1992")
     56    (number-of-pages . 368)))
     57
     58(test-group "openlibrary.org API"
     59            (test "Requesting entry for ISBN-10 09370-73890-6"
     60                  literate-programming
     61                  (isbn->alist "0937073806"))
     62            (test "Requesting same ISBN with restricted return values"
     63                  literate-programming-simplified
     64                  (isbn->alist "0937073806" '(title authors publishing-date number-of-pages))))
Note: See TracChangeset for help on using the changeset viewer.