2023-02-06 11:01:34 +00:00
|
|
|
#lang at-exp racket/base
|
|
|
|
;;; SPDX-License-Identifier: LGPL-3.0-or-later
|
2024-03-10 11:43:06 +00:00
|
|
|
;;; SPDX-FileCopyrightText: Copyright © 2023-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
2023-02-06 11:01:34 +00:00
|
|
|
|
|
|
|
(module+ test
|
|
|
|
(require rackunit)
|
|
|
|
(require syndicate/sturdy)
|
|
|
|
(require preserves)
|
|
|
|
|
|
|
|
(define s0 (mint "test" #""))
|
|
|
|
|
2023-02-10 11:04:21 +00:00
|
|
|
(check-equal? s0 (SturdyRef (Parameters "test"
|
|
|
|
#">\330w\326\3r{\216U`j\24\376\203\242\360"
|
|
|
|
(CaveatsField-absent))))
|
2023-02-06 11:01:34 +00:00
|
|
|
(check-true (SturdyRef-valid? s0 #""))
|
|
|
|
|
|
|
|
(define s1 (attenuate-sturdy s0 'a 'b 'c))
|
|
|
|
|
2023-02-10 11:04:21 +00:00
|
|
|
(check-equal? s1 (SturdyRef (Parameters "test"
|
|
|
|
#"\261\220\327\363X\317\202\251&\367\3734*\355\333\324"
|
|
|
|
(CaveatsField-present '(a b c)))))
|
2023-02-06 11:01:34 +00:00
|
|
|
(check-true (SturdyRef-valid? s1 #""))
|
|
|
|
(check-false (SturdyRef-valid?
|
2023-02-10 11:04:21 +00:00
|
|
|
(SturdyRef (Parameters "test"
|
|
|
|
#"\261\220\327\363X\317\202\251&\367\3734?\355\333\324"
|
|
|
|
(CaveatsField-present '(a b c))))
|
2023-02-06 11:01:34 +00:00
|
|
|
#""))
|
|
|
|
(check-false (SturdyRef-valid?
|
2023-02-10 11:04:21 +00:00
|
|
|
(SturdyRef (Parameters "test"
|
|
|
|
#"\261\220\327\363X\317\202\251&\367\3734*\355\333\324"
|
|
|
|
(CaveatsField-present '(a c b))))
|
2023-02-06 11:01:34 +00:00
|
|
|
#""))
|
|
|
|
|
|
|
|
)
|
|
|
|
|