Add evaluation test support
test-modules/online.scm
| 72 | 72 | (_ (update-test-case test #:result 'pass)))) | |
| 73 | 73 | ((member type '("TestTurtleNegativeSyntax" "TestTriGNegativeSyntax" | |
| 74 | 74 | "TestNTriplesNegativeSyntax" "TestNQuadsNegativeSyntax" | |
| 75 | - | "TestXMLNegativeSyntax")) | |
| 75 | + | "TestXMLNegativeSyntax" "TestTurtleNegativeEval")) | |
| 76 | 76 | (match result | |
| 77 | 77 | (((? symbol? key) . value) (update-test-case test #:result 'pass)) | |
| 78 | 78 | (_ (update-test-case test | |
| 79 | 79 | #:result 'fail | |
| 80 | 80 | #:reason "Expected failure but got success")))) | |
| 81 | + | ((equal? type "TestTurtleEval") | |
| 82 | + | (let* ((expected (car (get-objects predicates "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#result"))) | |
| 83 | + | (expected | |
| 84 | + | (catch #t | |
| 85 | + | (lambda () | |
| 86 | + | (if expected | |
| 87 | + | (turtle->rdf (get-test-doc expected) expected) | |
| 88 | + | #f)) | |
| 89 | + | (lambda (key . value) | |
| 90 | + | (cons key value))))) | |
| 91 | + | (match result | |
| 92 | + | (((? symbol? key) . value) | |
| 93 | + | (update-test-case test | |
| 94 | + | #:result 'fail | |
| 95 | + | #:reason (format #f "failed with ~a: ~a" key value))) | |
| 96 | + | (_ | |
| 97 | + | (if (rdf-isomorphic? result expected) | |
| 98 | + | (update-test-case test #:result 'pass) | |
| 99 | + | (update-test-case test | |
| 100 | + | #:result 'fail | |
| 101 | + | #:reason (format #f "expected ~a but got ~a" | |
| 102 | + | expected result))))))) | |
| 81 | 103 | (else | |
| 82 | 104 | (update-test-case test | |
| 83 | 105 | #:result 'skip |