aboutsummaryrefslogtreecommitdiff
path: root/tests/model-lint-warning-message.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-09-04 19:24:22 +0200
committerChristopher Baines <mail@cbaines.net>2019-09-05 16:07:23 +0200
commitd3913a14d55968e505429693a6df6125e3468300 (patch)
tree8f051b7b8906685297308cb82ea1bcdf2a9eeffe /tests/model-lint-warning-message.scm
parent6c90fe432496a2b2ace6984ac24beb7f7736ef1c (diff)
downloaddata-service-d3913a14d55968e505429693a6df6125e3468300.tar
data-service-d3913a14d55968e505429693a6df6125e3468300.tar.gz
Start handling ids as numbers, rather than strings
squee, returns all data as strings, and expects strings as inputs to queries. So, keeping the ids as strings was easy initially, but it means that you can't tell from the type whether it should be quoted, or not... Therefore, handle ids as strings, converting them to numbers when they're fetched from the database, and back to strings as part of the queries.
Diffstat (limited to 'tests/model-lint-warning-message.scm')
-rw-r--r--tests/model-lint-warning-message.scm18
1 files changed, 9 insertions, 9 deletions
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)