Add tests for 'pattern-plain?'.
* tests/unit/pattern.scm: Add tests for 'pattern-plain?'.
This commit is contained in:
parent
dd215ee926
commit
a009118efb
|
@ -1,5 +1,5 @@
|
|||
;;; Gash -- Guile As SHell
|
||||
;;; Copyright © 2018 Timothy Sample <samplet@ngyro.com>
|
||||
;;; Copyright © 2018, 2019 Timothy Sample <samplet@ngyro.com>
|
||||
;;;
|
||||
;;; This file is part of Gash.
|
||||
;;;
|
||||
|
@ -164,6 +164,27 @@
|
|||
|
||||
;; TODO: Test quoting.
|
||||
|
||||
|
||||
;;; Plain patterns
|
||||
|
||||
(test-assert "Recognizes plain patterns"
|
||||
(pattern-plain? (parse-pattern "foo")))
|
||||
|
||||
(test-assert "Asterisks at the start are not plain"
|
||||
(not (pattern-plain? (parse-pattern "*foo"))))
|
||||
|
||||
(test-assert "Asterisks at the end are not plain"
|
||||
(not (pattern-plain? (parse-pattern "foo*"))))
|
||||
|
||||
(test-assert "Asterisks in the middle are not plain"
|
||||
(not (pattern-plain? (parse-pattern "f*o"))))
|
||||
|
||||
(test-assert "Question marks are not plain"
|
||||
(not (pattern-plain? (parse-pattern "f?o"))))
|
||||
|
||||
(test-assert "Character classes are not plain"
|
||||
(not (pattern-plain? (parse-pattern "[fo]o"))))
|
||||
|
||||
(test-end)
|
||||
|
||||
;; Local Variables:
|
||||
|
|
Loading…
Reference in New Issue