1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
;; -*-theme-d-*-
;; Copyright (C) 2017, 2024 Tommi Höynälänmaa
;; Distributed under GNU General Public License version 3,
;; see file doc/GPL-3.
;; Expected results: translation and running OK
;; Expected output: #t #t #f #t #t #t #t #t
(define-proper-program (tests test562)
(import (standard-library core)
(standard-library console-io))
(define-foreign-prim-class <bytevector>
(attributes equal-by-value checked)
(member-pred bytevector?))
(define make-bytevector
(prim-proc make-bytevector (<integer> <integer>) <bytevector> (pure)))
(define bytevector-length
(prim-proc bytevector-length (<bytevector>) <integer> (pure)))
(define bytevector-u8-ref
(prim-proc bytevector-u8-ref (<bytevector> <integer>) <integer> (pure)))
(define bytevector-u8-set!
(prim-proc bytevector-u8-set! (<bytevector> <integer> <integer>) <none>
(nonpure)))
(define main
(lambda (() <none> nonpure)
(let ((bv1 (make-bytevector 10 128))
(bv2 (make-bytevector 10 128)))
(bytevector-u8-set! bv1 5 20)
(bytevector-u8-set! bv2 5 20)
(console-display-line (equal? bv1 bv2))
(console-display-line (equal-values? bv1 bv2))
(console-display-line (equal-objects? bv1 bv2))
(console-display-line (equal-contents? bv1 bv2))
(console-display-line (equal? bv1 bv1))
(console-display-line (equal-values? bv1 bv1))
(console-display-line (equal-objects? bv1 bv1))
(console-display-line (equal-contents? bv1 bv1))))))
|