PIKApp/plug-ins/script-fu/test/tests/PDB/refresh.scm

70 lines
1.8 KiB
Scheme
Raw Normal View History

2023-09-26 00:35:21 +02:00
; test refresh methods
; make the app read resources from configuration files
; methods of the app
; the app manages collections of resources
; app can refresh and list the resources.
; A collection is named by the plural of the singular element,
; i.e. brushes is a collection of brush.
; Deprecations:
; pika-palette-refresh
; pika-brushes-list => pika-brushes-get-list etc.
; pika-parasite-list => pika-get-parasite-list
; refresh
; always succeeds
; FIXME but wraps result in list (#t)
(assert `(car (pika-brushes-refresh)))
(assert `(car (pika-dynamics-refresh)))
(assert `(car (pika-fonts-refresh)))
(assert `(car (pika-gradients-refresh)))
(assert `(car (pika-palettes-refresh)))
(assert `(car (pika-patterns-refresh)))
; list
; always succeeds
; take an optional regex string
(assert `(list? (car (pika-brushes-get-list ""))))
(assert `(list? (car (pika-dynamics-get-list ""))))
(assert `(list? (car (pika-fonts-get-list ""))))
(assert `(list? (car (pika-gradients-get-list ""))))
(assert `(list? (car (pika-palettes-get-list ""))))
(assert `(list? (car (pika-patterns-get-list ""))))
; listing app's collection of things not resources
; But taking a regex
(assert `(list? (car (pika-buffers-get-list ""))))
; listing app's other collections not resources
; Not taking a regex
; FIXME the naming does not follow the pattern, should be plural parasites
; Not: (pika-parasites-get-list "")
(assert `(list? (car (pika-get-parasite-list))))
; the app, images, vectors, drawables, items
; can all have parasites.
; Tested elsewhere.
; pika-get-images does not follow the pattern:
; it doesn't take a regex
; and it returns a vector of image objects (0 #())
(assert `(vector? (cadr (pika-get-images))))