1 | ;-*- Mode: Lisp -*- |
---|

2 | ;;;; Author: Paul Dietz |
---|

3 | ;;;; Created: Wed Jan 22 21:23:45 2003 |
---|

4 | ;;;; Contains: Tests for SIMPLE-VECTOR-P |
---|

5 | |
---|

6 | (in-package :cl-test) |
---|

7 | |
---|

8 | ;;; More tests for this are in make-array.lsp |
---|

9 | |
---|

10 | (deftest simple-vector-p.1 |
---|

11 | (check-type-predicate #'simple-vector-p 'simple-vector) |
---|

12 | nil) |
---|

13 | |
---|

14 | (deftest simple-vector-p.2 |
---|

15 | (notnot-mv (simple-vector-p (make-array '(10)))) |
---|

16 | t) |
---|

17 | |
---|

18 | ;; (deftest simple-vector-p.3 |
---|

19 | ;; (simple-vector-p (make-array '(5) :fill-pointer t)) |
---|

20 | ;; nil) |
---|

21 | |
---|

22 | (deftest simple-vector-p.4 |
---|

23 | (notnot-mv (simple-vector-p (vector 'a 'b 'c))) |
---|

24 | t) |
---|

25 | |
---|

26 | ;;; (deftest simple-vector-p.5 |
---|

27 | ;;; (simple-vector-p (make-array '(5) :adjustable t)) |
---|

28 | ;;; nil) |
---|

29 | |
---|

30 | ;;; (deftest simple-vector-p.6 |
---|

31 | ;;; (let ((a #(a b c d e g h))) |
---|

32 | ;;; (simple-vector-p (make-array '(5) :displaced-to a))) |
---|

33 | ;;; nil) |
---|

34 | |
---|

35 | (deftest simple-vector-p.7 |
---|

36 | (simple-vector-p #*001101) |
---|

37 | nil) |
---|

38 | |
---|

39 | (deftest simple-vector-p.8 |
---|

40 | (simple-vector-p "abcdef") |
---|

41 | nil) |
---|

42 | |
---|

43 | (deftest simple-vector-p.9 |
---|

44 | (simple-vector-p (make-array nil)) |
---|

45 | nil) |
---|

46 | |
---|

47 | (deftest simple-vector-p.10 |
---|

48 | (simple-vector-p (make-array '(10) :element-type 'base-char)) |
---|

49 | nil) |
---|

50 | |
---|

51 | (deftest simple-vector-p.11 |
---|

52 | (simple-vector-p (make-array '(10) :element-type 'character)) |
---|

53 | nil) |
---|

54 | |
---|

55 | (deftest simple-vector-p.12 |
---|

56 | (simple-vector-p (make-array '(10) :element-type 'bit)) |
---|

57 | nil) |
---|

58 | |
---|

59 | ;;; Error tests |
---|

60 | |
---|

61 | (deftest simple-vector-p.error.1 |
---|

62 | (signals-error (simple-vector-p) program-error) |
---|

63 | t) |
---|

64 | |
---|

65 | (deftest simple-vector-p.error.2 |
---|

66 | (signals-error (simple-vector-p #(a b) nil) program-error) |
---|

67 | t) |
---|