[plt-translators] Translations for test engine
I'm working on providing string constants for the test engine. This is
quite a bit of stuff, and some sentence construction is going on. I'd
appreciate a quick once-over to see if I broke any obvious grammatical
rules.
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
-------------- next part --------------
Index: collects/string-constants/english-string-constants.ss
===================================================================
--- collects/string-constants/english-string-constants.ss (revision 14565)
+++ collects/string-constants/english-string-constants.ss (working copy)
@@ -1363,7 +1363,68 @@
;;Following two appear in Scheme (Java, etc) menu, cause Tests to be Run automatically or not
(test-engine-enable-tests "Enable Tests")
(test-engine-disable-tests "Disable Tests")
+
+ ;; The ~a is replaced by the translation of "test" or "check"
+ (test-engine-ran-1 "Ran 1 ~a.")
+ ;; ditto, only plural
+ (test-engine-ran-n "Ran ~a ~a.")
+ (test-engine-1-passed "The ~a passed!")
+ (test-engine-all-passed "All ~a passed!")
+ (test-engine-0-passed "0 ~a passed.")
+ (test-engine-m-of-n-failed "~a of the ~a ~a failed.")
+ (test-engine-check "check")
+ (test-engine-checks "checks")
+ (test-engine-test "test")
+ (test-engine-tests "tests")
+ (test-engine-must-be-tested "This program must be tested!")
+ (test-engine-is-unchecked "This program is unchecked!")
+ (test-engine-tests-disabled "Tests disabled.")
+ (test-engine-zero-tests-passed "Zero tests passed!")
+ (test-engine-the-only-test-passed "The only test passed.")
+ (test-engine-both-tests-passed "Both tests passed.")
+ ; ~a is replaced by count
+ (test-engine-all-tests-passed "All ~a tests passed!")
+ (test-engine-should-be-tested "This program should be tested.")
+ ; as in "at line xxx, column xxx"
+ (test-engine-at "at")
+ ; as in "in file ..."
+ (test-engine-in "in")
+ (test-engine-line "line")
+ (test-engine-column "column")
+ ; as in "column (unknown)"
+ (test-engine-unknown "unknown")
+ (test-engine-trace-error "Trace error")
+
+ (test-engine-check-encountered-error
+ "check encountered the following error instead of the expected value")
+
+ ; parts of a phrase
+ (test-engine-actual-value "Actual value")
+ (test-engine-differs-from "differs from")
+ (test-engine-the-expected-value "the expected value")
+ (test-engine-not-within "is not within ~v of expected value")
+ (test-engine-check-error-encountered-error
+ "check-error encountered the following error instead of the expected ~a")
+ (test-engine-check-error-received
+ "check-error expected the following error, but instead received the value")
+
+ ; section header
+ (test-engine-check-failures "Check failures:")
+ ; section header
+ (test-engine-contract-violations "Contract violations:")
+
+ ; part of one phrase "contract <at line ...> to blame: procedure <...>
+ (test-engine-contract "contract")
+ (test-engine-to-blame "to blame: procedure")
+
+ (test-engine-no-contract-violations "No contract violations.")
+ (test-engine-1-contract-violation "1 contract violation.")
+ (test-engine-n-contract-violations "~a contract violations.")
+
+ ; as in got <value>, contract <at ...>
+ (test-engine-got "got")
+
(profjWizward-insert-java-class "Insert Java Class")
(profjWizard-insert-java-union "Insert Java Union")
Index: collects/string-constants/german-string-constants.ss
===================================================================
--- collects/string-constants/german-string-constants.ss (revision 14565)
+++ collects/string-constants/german-string-constants.ss (working copy)
@@ -1267,6 +1267,67 @@
(test-engine-enable-tests "Test aktivieren")
(test-engine-disable-tests "Tests deaktivieren Tests")
+ ;; The ~a is replaced by the translation of "test" or "check"
+ (test-engine-ran-1 "1 ~a gelaufen.")
+ ;; ditto, only plural
+ (test-engine-ran-n "~a ~a gelaufen.")
+ (test-engine-1-passed "Der eine ~a war erfolgreich!")
+ (test-engine-all-passed "Alle ~a waren erfolgreich!")
+ (test-engine-0-passed "0 ~a waren erfolgreich.")
+ (test-engine-m-of-n-failed "~a der ~a ~a sind fehlgeschlagen.")
+ (test-engine-check "Check")
+ (test-engine-checks "Checks")
+ (test-engine-test "Test")
+ (test-engine-tests "Tests")
+ (test-engine-must-be-tested "Dieses Programm muss noch getestet werden!")
+ (test-engine-is-unchecked "Dieses Programm hat keine Checks!")
+ (test-engine-tests-disabled "Tests deaktiviert.")
+ (test-engine-zero-tests-passed "Keine Tests waren erfolgreich!")
+ (test-engine-the-only-test-passed "Der einzige Test war erfolgreich.")
+ (test-engine-both-tests-passed "Beide Tests waren erfolgreich.")
+ ; ~a is replaced by count
+ (test-engine-all-tests-passed "Alle ~a Tests waren erfolgreich!")
+ (test-engine-should-be-tested "Dieses Programm sollte getestet werden.")
+ ; as in "at line xxx, column xxx"
+ (test-engine-at "bei")
+ ; as in "in file ..."
+ (test-engine-in "in")
+ (test-engine-line "Zeile")
+ (test-engine-column "Spalte")
+ ; as in "column (unknown)"
+ (test-engine-unknown "unbekannt")
+ (test-engine-trace-error "Trace-Fehler")
+
+ (test-engine-check-encountered-error
+ "`check-expect' bekam folgenden Fehler statt des erwarteten Werts")
+
+ ; parts of a phrase
+ (test-engine-actual-value "Tatsächlicher Wert")
+ (test-engine-differs-from "ist nicht")
+ (test-engine-the-expected-value "der erwartete Wert")
+
+ (test-engine-not-within "ist bis auf höchstens ~v am erwarteten Wert")
+ (test-engine-check-error-encountered-error
+ "`check-error' bekam den folgenden Fehler statt des erwarteten Fehlers ~a")
+ (test-engine-check-error-received
+ "`check-error' erwartete den folgenden Fehler aber bekam stattdessen den Wert")
+
+ ; section header
+ (test-engine-check-failures "Check-Fehler:")
+ ; section header
+ (test-engine-contract-violations "Vertragsverletzungen:")
+
+ ; part of one phrase "contract <at line ...> to blame: procedure <at line ...>
+ (test-engine-contract "Vertrag")
+ (test-engine-to-blame "verantwortlich: Prozedur")
+
+ (test-engine-no-contract-violations "Keine Vertragsverletzungen.")
+ (test-engine-1-contract-violation "1 Vertragsverletzung.")
+ (test-engine-n-contract-violations "~a Vertragsverletzungen.")
+
+ ; as in got <value>, contract <at ...>
+ (test-engine-got "bekam")
+
(profjWizward-insert-java-class "Java-Klasse einfügen")
(profjWizard-insert-java-union "Java-Vereinigung einfügen")
Index: collects/test-engine/test-display.scm
===================================================================
--- collects/test-engine/test-display.scm (revision 14565)
+++ collects/test-engine/test-display.scm (working copy)
@@ -80,49 +80,67 @@
[failed-tests (send test-info tests-failed)]
[total-checks (send test-info checks-run)]
[failed-checks (send test-info checks-failed)]
- [test-outcomes
- (lambda (zero-message)
+ [outcomes
+ (lambda (total failed zero-message ck cks)
(send editor insert
(cond
- [(zero? total-tests) zero-message]
- [(= 1 total-tests) "Ran 1 test.\n"]
- [else (format "Ran ~a tests.\n" total-tests)]))
- (when (> total-tests 0)
+ [(zero? total) zero-message]
+ [(= 1 total)
+ (format (string-append (string-constant test-engine-ran-1) "\n")
+ ck)]
+ [else
+ (format (string-append (string-constant test-engine-ran-n) "\n")
+ total cks)]))
+ (when (> total 0)
(send editor insert
(cond
- [(and (zero? failed-tests) (= 1 total-tests))
- "Test passed!\n\n"]
- [(zero? failed-tests) "All tests passed!\n\n"]
- [(= failed-tests total-tests) "0 tests passed.\n"]
- [else (format "~a of the ~a tests failed.\n\n" failed-tests total-tests)]))))]
- [check-outcomes
- (lambda (zero-message ck)
- (send editor insert
- (cond
- [(zero? total-checks) zero-message]
- [(= 1 total-checks) (format "Ran 1 ~a.\n" ck)]
- [else (format "Ran ~a ~as.\n" total-checks ck)]))
- (when (> total-checks 0)
- (send editor insert
- (cond
- [(and (zero? failed-checks) (= 1 total-checks))
- (format "The ~a passed!\n\n" ck)]
- [(zero? failed-checks) (format "All ~as passed!\n\n" ck)]
- [(= failed-checks total-checks) (format "0 ~as passed.\n" ck)]
- [else (format "~a of the ~a ~as failed.\n\n"
- failed-checks total-checks ck)]))))])
+ [(and (zero? failed) (= 1 total))
+ (format (string-append (string-constant test-engine-1-passed) "\n\n")
+ ck)]
+ [(zero? failed)
+ (format (string-append (string-constant test-engine-all-passed) "\n\n")
+ cks)]
+ [(= failed total)
+ (format (string-append (string-constant test-engine-0-passed) "\n")
+ cks)]
+ [else
+ (format (string-append (string-constant test-engine-m-of-n-failed) "\n\n")
+ failed total cks)]))))]
+ [check-outcomes/check
+ (lambda (zero-message)
+ (outcomes total-checks failed-checks
+ zero-message
+ (string-constant test-engine-check)
+ (string-constant test-engine-checks)))]
+ [check-outcomes/test
+ (lambda (zero-message)
+ (outcomes total-checks failed-checks
+ zero-message
+ (string-constant test-engine-test)
+ (string-constant test-engine-tests)))]
+ [test-outcomes
+ (lambda (zero-message)
+ (outcomes total-tests failed-tests
+ zero-message
+ (string-constant test-engine-test)
+ (string-constant test-engine-tests)))])
(case style
[(test-require)
- (test-outcomes "This program must be tested!\n")
- (check-outcomes "This program is unchecked!\n" "check")]
+ (test-outcomes
+ (string-append (string-constant test-engine-must-be-tested) "\n"))
+ (check-outcomes/check
+ (string-append (string-constant test-engine-is-unchecked) "\n"))]
[(check-require)
- (check-outcomes "This program is unchecked!\n" "check")]
+ (check-outcomes/check
+ (string-append (string-constant test-engine-is-unchecked) "\n"))]
[(test-basic)
(test-outcomes "")
- (check-outcomes "" "check")]
+ (check-outcomes/check "")]
[(test-check)
- (check-outcomes "This program must be tested.\n" "test")]
- [else (check-outcomes "" "check")])
+ (check-outcomes/test
+ (string-append (string-constant test-engine-must-be-tested)
+ "\n"))]
+ [else (check-outcomes/check "")])
(unless (and (zero? total-checks) (zero? total-tests))
(inner (display-check-failures (send test-info failed-checks)
@@ -175,7 +193,8 @@
(define (make-error-link text msg exn dest src-editor)
(make-link text msg dest src-editor)
(let ((start (send text get-end-position)))
- (send text insert "Trace error ")
+ (send text insert (string-constant test-engine-trace-error))
+ (send text insert " ")
(when (and src-editor current-rep)
(send text set-clickback
start (send text get-end-position)
@@ -197,13 +216,32 @@
[src-col caddr])
(string-append
(cond
- [(symbol? (src-file src)) (string-append " At ")]
- [(path? (src-file src)) (string-append " In " (path->string (src-file src)) " at ")]
- [(is-a? (src-file src) editor<%>) " At "])
- "line " (cond [(src-line src) => number->string]
- [else "(unknown)"])
- " column " (cond [(src-col src) => number->string]
- [else "(unknown)"]))))
+ [(symbol? (src-file src))
+ (string-append " "
+ (string-titlecase (string-constant test-engine-at))
+ " ")]
+ [(path? (src-file src))
+ (string-append " "
+ (string-titlecase (string-constant test-engine-in))
+ " "
+ (path->string (src-file src))
+ " "
+ (string-constant test-engine-at)
+ " ")]
+ [(is-a? (src-file src) editor<%>)
+ (string-append " "
+ (string-titlecase (string-constant test-engine-at))
+ " ")])
+ (string-constant test-engine-line)
+ " "
+ (cond [(src-line src) => number->string]
+ [else
+ (string-append "(" (string-constant test-engine-unknown) ")")])
+ " "
+ (string-constant test-engine-column)
+ " "
+ (cond [(src-col src) => number->string]
+ [else (string-append "(" (string-constant test-engine-unknown) ")")]))))
(define (highlight-check-error srcloc src-editor)
(let* ([src-pos cadddr]
Index: collects/test-engine/test-engine.scm
===================================================================
--- collects/test-engine/test-engine.scm (revision 14565)
+++ collects/test-engine/test-engine.scm (working copy)
@@ -1,6 +1,7 @@
#lang scheme/base
(require scheme/class
+ string-constants
"test-info.scm")
(define test-display-textual%
@@ -22,46 +23,65 @@
[failed-tests (send test-info tests-failed)]
[total-checks (send test-info checks-run)]
[failed-checks (send test-info checks-failed)]
- [test-outcomes
- (lambda (zero-message)
- (printf "~a"
- (cond [(zero? total-tests) zero-message]
- [(= 1 total-tests) "Ran 1 test.\n"]
- [else (format "Ran ~a tests.\n" total-tests)]))
+ [outcomes
+ (lambda (total failed zero-message ck cks)
+ (display (cond
+ [(zero? total) zero-message]
+ [(= 1 total)
+ (format (string-append (string-constant test-engine-ran-1) "\n")
+ ck)]
+ [else
+ (format (string-append (string-constant test-engine-ran-n) "\n")
+ total cks)]))
(when (> total-tests 0)
- (printf "~a"
- (cond
- [(and (zero? failed-tests) (= 1 total-tests))
- "Test passed!\n\n"]
- [(zero? failed-tests) "All tests passed!\n\n"]
- [(= failed-tests total-tests) "0 tests passed.\n"]
- [else "~a of the ~a tests failed.\n\n"]))))]
- [check-outcomes
- (lambda (zero-message)
- (printf "~a"
- (cond
- [(zero? total-checks) zero-message]
- [(= 1 total-checks) "Ran 1 check.\n"]
- [else (format "Ran ~a checks.\n" total-checks)]))
- (when (> total-checks 0)
- (printf "~a"
- (cond
- [(and (zero? failed-checks) (= 1 total-checks))
- "Check passed!\n\n"]
- [(zero? failed-checks) "All checks passed!\n\n"]
- [(= failed-checks total-checks) "0 checks passed.\n"]
- [else (format "~a of the ~a checks failed.\n\n"
- failed-checks total-checks)]))))])
+ (display (cond
+ [(and (zero? failed) (= 1 total))
+ (format (string-append (string-constant test-engine-1-passed) "\n\n")
+ ck)]
+ [(zero? failed)
+ (format (string-append (string-constant test-engine-all-passed) "\n\n")
+ cks)]
+ [(= failed total)
+ (format (string-append (string-constant test-engine-0-passed) "\n")
+ cks)]
+ [else
+ (format (string-append (string-constant test-engine-m-of-n-failed) "\n\n")
+ failed total cks)]))))]
+ [check-outcomes/check
+ (lambda (zero-message)
+ (outcomes total-checks failed-checks
+ zero-message
+ (string-constant test-engine-check)
+ (string-constant test-engine-checks)))]
+ [check-outcomes/test
+ (lambda (zero-message)
+ (outcomes total-checks failed-checks
+ zero-message
+ (string-constant test-engine-test)
+ (string-constant test-engine-tests)))]
+ [test-outcomes
+ (lambda (zero-message)
+ (outcomes total-tests failed-tests
+ zero-message
+ (string-constant test-engine-test)
+ (string-constant test-engine-tests)))])
(case style
[(test-require)
- (test-outcomes "This program must be tested!\n")
- (check-outcomes "This program is unchecked!\n")]
+ (test-outcomes
+ (string-append (string-constant test-engine-must-be-tested) "\n"))
+ (check-outcomes/check
+ (string-append (string-constant test-engine-is-unchecked) "\n"))]
[(check-require)
- (check-outcomes "This program is unchecked!\n")]
+ (check-outcomes/check
+ (string-append (string-constant test-engine-is-unchecked) "\n"))]
[(test-basic)
(test-outcomes "")
- (check-outcomes "")]
- [else (check-outcomes "")])
+ (check-outcomes/check "")]
+ [(test-check)
+ (check-outcomes/test
+ (string-append (string-constant test-engine-must-be-tested)
+ "\n"))]
+ [else (check-outcomes/check "")])
(unless (and (zero? total-checks) (zero? total-tests))
(inner (display-check-failures (send test-info failed-checks)
@@ -142,7 +162,7 @@
[(mixed-results)
(display-results display-rep display-event-space)]))]
[else
- (fprintf port "Tests disabled.\n")]))
+ (display (string-append (string-constant test-engine-tests-disabled) "\n") port)]))
(define/private (display-success port event count)
(when event
@@ -150,16 +170,18 @@
((dynamic-require 'scheme/gui 'queue-callback)
(lambda () (send test-display report-success)))))
(unless (test-silence)
- (fprintf port "~a test~a passed!\n"
- (case count
- [(0) "Zero"]
- [(1) "The only"]
- [(2) "Both"]
- [else (format "All ~a" count)])
- (if (= count 1) "" "s"))))
+ (display (case count
+ [(0) (string-constant test-engine-zero-tests-passed)]
+ [(1) (string-constant test-engine-the-only-test-passed)]
+ [(2) (string-constant test-engine-both-tests-passed)]
+ [else (format (string-constant test-engine-all-tests-passed)
+ count)])
+ port)))
(define/public (display-untested port)
(unless (test-silence)
- (fprintf port "This program should be tested.~n")))
+ (display (string-append (string-constant test-engine-should-be-tested)
+ "\n")
+ port)))
(define/public (display-results rep event-space)
(cond
[(and rep event-space)
Index: collects/test-engine/scheme-tests.ss
===================================================================
--- collects/test-engine/scheme-tests.ss (revision 14565)
+++ collects/test-engine/scheme-tests.ss (working copy)
@@ -3,6 +3,7 @@
(require lang/private/teachprims
scheme/class
scheme/match
+ string-constants
(only scheme/base for)
"test-engine.scm"
)
@@ -206,27 +207,39 @@
(define (check->message fail)
(cond
[(unexpected-error? fail)
- (list "check encountered the following error instead of the expected value, "
+ (list (string-constant test-engine-check-encountered-error)
+ ", "
((test-format) (unexpected-error-expected fail))
(format ". ~n :: ~a~n" (unexpected-error-message fail)))]
[(unequal? fail)
- (list "Actual value "
+ (list (string-constant test-engine-actual-value)
+ " "
((test-format) (unequal-test fail))
- " differs from "
+ " "
+ (string-constant test-engine-differs-from)
+ " "
((test-format) (unequal-actual fail))
- ", the expected value.\n")]
+ ", "
+ (string-constant test-engine-the-expected-value)
+ ".\n")]
[(outofrange? fail)
- (list "Actual value "
+ (list (string-constant test-engine-actual-value)
+ " "
((test-format) (outofrange-test fail))
- (format " is not within ~v of expected value " (outofrange-range fail))
+ " "
+ (format (string-constant test-engine-not-within)
+ (outofrange-range fail))
+ " "
((test-format) (outofrange-actual fail))
".\n")]
[(incorrect-error? fail)
- (list (format "check-error encountered the following error instead of the expected ~a~n :: ~a ~n"
- (incorrect-error-expected fail)
+ (list (format (string-constant test-engine-check-error-encountered-error)
+ (incorrect-error-expected fail))
+ (format "~n :: ~a ~n"
(incorrect-error-message fail)))]
[(expected-error? fail)
- (list "check-error expected the following error, but instead received the value "
+ (list (string-constant test-engine-check-error-received)
+ " "
((test-format) (expected-error-value fail))
(format ".~n ~a~n" (expected-error-message fail)))]))
Index: collects/deinprogramm/contract/contract-test-display.ss
===================================================================
--- collects/deinprogramm/contract/contract-test-display.ss (revision 14565)
+++ collects/deinprogramm/contract/contract-test-display.ss (working copy)
@@ -90,28 +90,39 @@
(send editor insert
(cond
[(zero? total-checks) zero-message]
- [(= 1 total-checks) "Ran 1 check.\n"]
- [else (format "Ran ~a checks.\n" total-checks)]))
+ [(= 1 total-checks)
+ (format (string-append (string-constant test-engine-ran-1) "\n")
+ (string-constant test-engine-check))]
+ [else (format (string-append (string-constant test-engine-ran-n) "\n")
+ total-checks (string-constant test-engine-checks))]))
(when (> total-checks 0)
(send editor insert
(cond
[(and (zero? failed-checks) (= 1 total-checks))
- "Check passed!\n\n"]
- [(zero? failed-checks) "All checks passed!\n\n"]
- [(= failed-checks total-checks) "0 checks passed.\n"]
- [else (format "~a of the ~a checks failed.\n\n"
- failed-checks total-checks)])))
+ (format (string-append (string-constant test-engine-1-passed) "\n\n")
+ (string-constant test-engine-check))]
+ [(zero? failed-checks)
+ (format (string-append (string-constant test-engine-all-passed) "\n\n")
+ (string-constant test-engine-checks))]
+ [(= failed-checks total-checks)
+ (format (string-append (string-constant test-engine-0-passed) "\n")
+ (string-constant test-engine-checks))]
+ [else (format (string-append (string-constant test-engine-m-of-n-failed) "\n\n")
+ failed-checks total-checks
+ (string-constant test-engine-checks))])))
(send editor insert
(cond
((null? violated-contracts)
- "No contract violations!\n\n")
+ (string-append (string-constant test-engine-no-contract-violations) "\n\n"))
+ ((null? (cdr violated-contracts))
+ (string-append (string-constant test-engine-1-contract-violation) "\n\n"))
(else
- (format "~a contract violations.\n\n"
+ (format (string-append (string-constant test-engine-n-contract-violations) "\n\n")
(length violated-contracts)))))
)])
(case style
[(check-require)
- (check-outcomes "This program is unchecked!\n")]
+ (check-outcomes (string-append (string-constant test-engine-is-unchecked) "\n"))]
[else (check-outcomes "")])
(unless (and (zero? total-checks)
@@ -126,7 +137,7 @@
(define/public (display-check-failures checks editor test-info src-editor)
(when (pair? checks)
- (send editor insert "Check failures:\n"))
+ (send editor insert (string-append (string-constant test-engine-check-failures) "\n")))
(for ([failed-check (reverse checks)])
(send editor insert "\t")
(if (failed-check-exn? failed-check)
@@ -143,7 +154,7 @@
(define/public (display-contract-violations violations editor test-info src-editor)
(when (pair? violations)
- (send editor insert "Contract violations:\n"))
+ (send editor insert (string-append (string-constant test-engine-contract-violations) "\n")))
(for-each (lambda (violation)
(send editor insert "\t")
(make-contract-link editor violation src-editor)
@@ -170,7 +181,8 @@
(define (make-error-link text msg exn dest src-editor)
(make-link text msg dest src-editor)
(let ((start (send text get-end-position)))
- (send text insert "Trace error ")
+ (send text insert (string-constant test-engine-trace-error))
+ (send text insert " ")
(when (and src-editor current-rep)
(send text set-clickback
start (send text get-end-position)
@@ -205,13 +217,16 @@
(highlight-error line column pos span src-editor))
#f #f)
(set-clickback-style text start "blue")))
- (send text insert ", contract ")
+ (send text insert ", ")
+ (send text insert (string-constant test-engine-contract))
+ (send text insert " ")
(format-clickable-syntax-src text stx src-editor)
(cond
((contract-violation-blame violation)
=> (lambda (blame)
(next-line text)
- (send text insert "to blame: procedure ")
+ (send text insert (string-constant test-engine-to-blame))
+ (send text insert " ")
(format-clickable-syntax-src text blame src-editor))))))
(define (format-clickable-syntax-src text stx src-editor)
@@ -248,13 +263,26 @@
(let-values (((base name must-be-dir?)
(split-path file)))
(if (path? name)
- (string-append " in " (path->string name) " at ")
+ (string-append " "
+ (string-constant test-engine-in)
+ " "
+ (path->string name)
+ " "
+ (string-constant test-engine-at)
+ " ")
""))
"")
- "at line " (cond [line => number->string]
- [else "(unknown)"])
- " column " (cond [column => number->string]
- [else "(unknown)"])))
+ (string-constant test-engine-at)
+ " "
+ (string-constant test-engine-line)
+ " "
+ (cond [line => number->string]
+ [else (string-append "(" (string-constant test-engine-unknown) ")")])
+ " "
+ (string-constant test-engine-column)
+ " "
+ (cond [column => number->string]
+ [else (string-append "(" (string-constant test-engine-unknown) ")")])))
(define (highlight-error line column position span src-editor)
(when (and current-rep src-editor)
Index: collects/deinprogramm/contract/contract-test-engine.ss
===================================================================
--- collects/deinprogramm/contract/contract-test-engine.ss (revision 14565)
+++ collects/deinprogramm/contract/contract-test-engine.ss (working copy)
@@ -6,6 +6,7 @@
contract-violation-blame contract-violation-srcloc)
(require scheme/class
+ string-constants
(lib "test-engine/test-engine.scm")
(lib "test-engine/test-info.scm"))
@@ -72,18 +73,18 @@
[(mixed-results)
(display-results display-rep display-event-space)]))))
(else
- (fprintf port "Tests disabled.\n"))))
+ (display (string-append (string-constant test-engine-tests-disabled) "\n") port))))
(define/private (display-success port event-space count)
(clear-results event-space)
(unless (test-silence)
- (fprintf port "~a test~a passed!\n"
- (case count
- [(0) "Zero"]
- [(1) "The only"]
- [(2) "Both"]
- [else (format "All ~a" count)])
- (if (= count 1) "" "s"))))
+ (display (case count
+ [(0) (string-constant test-engine-zero-tests-passed)]
+ [(1) (string-constant test-engine-the-only-test-passed)]
+ [(2) (string-constant test-engine-both-tests-passed)]
+ [else (format (string-constant test-engine-all-tests-passed)
+ count)])
+ port)))
(define/override (display-results rep event-space)
(cond
@@ -126,7 +127,7 @@
(messages
(if message
(list message)
- (list "got " ((test-format) obj)))))
+ (list (string-constant test-engine-got) " " ((test-format) obj)))))
(set! contract-violations
(cons (make-contract-violation obj contract messages srcloc blame)