test-hashtables-weak-key.scm 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. ;;; Copyright (C) 2025 Igalia, S.L.
  2. ;;; Copyright (C) 2024 David Thompson <dave@spritely.institute>
  3. ;;; Copyright (C) 2023, 2024 Robin Templeton
  4. ;;;
  5. ;;; Licensed under the Apache License, Version 2.0 (the "License");
  6. ;;; you may not use this file except in compliance with the License.
  7. ;;; You may obtain a copy of the License at
  8. ;;;
  9. ;;; http://www.apache.org/licenses/LICENSE-2.0
  10. ;;;
  11. ;;; Unless required by applicable law or agreed to in writing, software
  12. ;;; distributed under the License is distributed on an "AS IS" BASIS,
  13. ;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. ;;; See the License for the specific language governing permissions and
  15. ;;; limitations under the License.
  16. ;;; Commentary:
  17. ;;;
  18. ;;; Hashtable tests.
  19. ;;;
  20. ;;; Code:
  21. (use-modules (srfi srfi-64)
  22. (test utils)
  23. (test hashtable-utils))
  24. (test-begin "test-hashtables-weak-key")
  25. (with-additional-imports ((hoot hashtables))
  26. ;; FIXME: These would need to be run in an async context in order
  27. ;; for any finalization to happen in the Hoot VM, but at least we
  28. ;; ensure that the main interface is working.
  29. (test-hashtable-impl make-weak-key-hashtable
  30. make-eq-weak-key-hashtable
  31. make-eqv-weak-key-hashtable
  32. weak-key-hashtable?
  33. weak-key-hashtable-hash
  34. weak-key-hashtable-equiv
  35. weak-key-hashtable-size
  36. weak-key-hashtable-ref
  37. weak-key-hashtable-set!
  38. weak-key-hashtable-delete!
  39. weak-key-hashtable-clear!
  40. weak-key-hashtable-contains?
  41. weak-key-hashtable-copy
  42. weak-key-hashtable-keys
  43. weak-key-hashtable-values
  44. weak-key-hashtable-for-each
  45. weak-key-hashtable-fold))
  46. (test-end* "test-hashtables-weak-key")