Fix date formating in earl driver
test-modules/result.scm
| 92 | 92 | (force-output))) | |
| 93 | 93 | (const #t))) | |
| 94 | 94 | ||
| 95 | + | (define (get-date) | |
| 96 | + | (let* ((date (date->string (current-date) "~4")) | |
| 97 | + | (len (string-length date))) | |
| 98 | + | (string-append | |
| 99 | + | (substring date 0 (- len 2)) | |
| 100 | + | ":" | |
| 101 | + | (substring date (- len 2))))) | |
| 102 | + | ||
| 95 | 103 | (define (earl-driver port) | |
| 96 | 104 | "A driver that creates a turtle file report using the earl vocabulary. It | |
| 97 | 105 | doesn't use any internal representation for RDF or Turtle, it only manipulates | |
… | |||
| 128 | 136 | (format port " foaf:name \"Julien Lepiller\"^^xsd:string .~%") | |
| 129 | 137 | (format port "~%") | |
| 130 | 138 | (format port "<> foaf:primaryTopic <https://framagit.org/tyreunom/guile-jsonld>;~%") | |
| 131 | - | (format port " dc:issued \"~a\"^^xsd:dateTime;~%" | |
| 132 | - | (date->string (current-date) "~4")) | |
| 139 | + | (format port " dc:issued \"~a\"^^xsd:dateTime;~%" (get-date)) | |
| 133 | 140 | (format port " foaf:maker <https://lepiller.eu/#me> .~%") | |
| 134 | 141 | (format port "~%") | |
| 135 | 142 | (format #t "~a test cases for report~%" (length cases))) | |
… | |||
| 147 | 154 | ('fail "failed") | |
| 148 | 155 | ('xpass "cantTell") | |
| 149 | 156 | ('xfail "untested"))) | |
| 150 | - | (format port " dc:date \"~a\"^^xsd:dateTime ] ;~%" | |
| 151 | - | (date->string (current-date) "~4")) | |
| 157 | + | (format port " dc:date \"~a\"^^xsd:dateTime ] ;~%" (get-date)) | |
| 152 | 158 | (format port " earl:mode earl:automatic ] .~%") | |
| 153 | 159 | (format port "~%") | |
| 154 | 160 | (format #t "Tested ~a: ~a~%" | |