diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/model-git-repository.scm | 22 | ||||
-rw-r--r-- | tests/model-lint-checker.scm | 10 | ||||
-rw-r--r-- | tests/model-lint-warning-message.scm | 18 | ||||
-rw-r--r-- | tests/model-package-metadata.scm | 2 |
4 files changed, 26 insertions, 26 deletions
diff --git a/tests/model-git-repository.scm b/tests/model-git-repository.scm index befcbfa..ee72f24 100644 --- a/tests/model-git-repository.scm +++ b/tests/model-git-repository.scm @@ -1,4 +1,5 @@ (define-module (test-model-git-repository) + #:use-module (ice-9 match) #:use-module (srfi srfi-64) #:use-module (guix-data-service database) #:use-module (guix-data-service model git-repository)) @@ -12,22 +13,21 @@ (with-postgresql-transaction conn (lambda (conn) - (number? - (string->number - (git-repository-url->git-repository-id - conn - "test-non-existent-url")))) + (match (git-repository-url->git-repository-id + conn + "test-non-existent-url") + ((? number? x) + #t))) #:always-rollback? #t)) - (test-assert "returns the right id for an existing URL" + (let* ((url "test-url") + (id (git-repository-url->git-repository-id conn url))) (with-postgresql-transaction conn (lambda (conn) - (let* ((url "test-url") - (id (git-repository-url->git-repository-id conn url))) - (string=? - id - (git-repository-url->git-repository-id conn url)))) + (test-equal "returns the right id for an existing URL" + id + (git-repository-url->git-repository-id conn url))) #:always-rollback? #t)))) (test-end) diff --git a/tests/model-lint-checker.scm b/tests/model-lint-checker.scm index 64088e5..bbc79de 100644 --- a/tests/model-lint-checker.scm +++ b/tests/model-lint-checker.scm @@ -18,7 +18,7 @@ conn (lambda (conn) (match (lint-checkers->lint-checker-ids conn data) - (((? string? id1) (? string? id2)) + (((? number? id1) (? number? id2)) #t))) #:always-rollback? #t)) @@ -27,11 +27,11 @@ conn (lambda (conn) (match (lint-checkers->lint-checker-ids conn data) - (((? string? id1) (? string? id2)) + (((? number? id1) (? number? id2)) (match (lint-checkers->lint-checker-ids conn data) - (((? string? second-id1) (? string? second-id2)) - (and (string=? id1 second-id1) - (string=? id2 second-id2))))))) + (((? number? second-id1) (? number? second-id2)) + (and (eq? id1 second-id1) + (eq? id2 second-id2))))))) #:always-rollback? #t)))) (test-end) diff --git a/tests/model-lint-warning-message.scm b/tests/model-lint-warning-message.scm index c6fad55..746dcca 100644 --- a/tests/model-lint-warning-message.scm +++ b/tests/model-lint-warning-message.scm @@ -18,7 +18,7 @@ conn (lambda (conn) (match (lint-warning-message-data->lint-warning-message-ids conn data) - (((? string? id1) (? string? id2)) + (((? number? id1) (? number? id2)) #t))) #:always-rollback? #t)) @@ -27,11 +27,11 @@ conn (lambda (conn) (match (lint-warning-message-data->lint-warning-message-ids conn data) - (((? string? id1) (? string? id2)) + (((? number? id1) (? number? id2)) (match (lint-warning-message-data->lint-warning-message-ids conn data) - (((? string? second-id1) (? string? second-id2)) - (and (string=? id1 second-id1) - (string=? id2 second-id2))))))) + (((? number? second-id1) (? number? second-id2)) + (and (eq? id1 second-id1) + (eq? id2 second-id2))))))) #:always-rollback? #t)) (test-assert "single set insert" @@ -39,7 +39,7 @@ conn (lambda (conn) (match (lint-warning-message-data->lint-warning-message-set-id conn data) - ((? string? id1) + ((? number? id1) #t))) #:always-rollback? #t)) @@ -48,10 +48,10 @@ conn (lambda (conn) (match (lint-warning-message-data->lint-warning-message-set-id conn data) - ((? string? id) + ((? number? id) (match (lint-warning-message-data->lint-warning-message-set-id conn data) - ((? string? second-id) - (string=? id second-id)))))) + ((? number? second-id) + (eq? id second-id)))))) #:always-rollback? #t)))) (test-end) diff --git a/tests/model-package-metadata.scm b/tests/model-package-metadata.scm index 015a0b2..21ca55b 100644 --- a/tests/model-package-metadata.scm +++ b/tests/model-package-metadata.scm @@ -58,7 +58,7 @@ (list mock-inferior-package-foo mock-inferior-package-foo-2) (test-license-set-ids conn)) - ((x) (string? x)))) + ((x) (number? x)))) #:always-rollback? #t)) (with-postgresql-transaction |