diff options
| author | Nicolas Petton | 2015-04-18 16:35:43 +0200 |
|---|---|---|
| committer | Nicolas Petton | 2015-04-18 16:35:43 +0200 |
| commit | 35c27cd5818bede77279dc7e5cf1beec93766baa (patch) | |
| tree | 60311e38c60f099ddd963547336ac49f202c4db8 /test | |
| parent | c3acb3258df5fc0987fdd233062632ed030923d9 (diff) | |
| download | emacs-35c27cd5818bede77279dc7e5cf1beec93766baa.tar.gz emacs-35c27cd5818bede77279dc7e5cf1beec93766baa.zip | |
Throw an error when converting a map into an unknown map type
* lisp/emacs-lisp/map.el (map-into): Throw an error if type is not valid.
* test/automated/map-test.el: Add a regression test.
Diffstat (limited to 'test')
| -rw-r--r-- | test/automated/map-test.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/automated/map-test.el b/test/automated/map-test.el index 8a12be84aa1..ea7b0af3f46 100644 --- a/test/automated/map-test.el +++ b/test/automated/map-test.el | |||
| @@ -318,7 +318,8 @@ | |||
| 318 | (assert (equal (map-values (map-into (map-into ht 'list) 'hash-table)) | 318 | (assert (equal (map-values (map-into (map-into ht 'list) 'hash-table)) |
| 319 | (map-values ht))) | 319 | (map-values ht))) |
| 320 | (assert (null (map-into nil 'list))) | 320 | (assert (null (map-into nil 'list))) |
| 321 | (assert (map-empty-p (map-into nil 'hash-table))))) | 321 | (assert (map-empty-p (map-into nil 'hash-table))) |
| 322 | (should-error (map-into [1 2 3] 'string)))) | ||
| 322 | 323 | ||
| 323 | (provide 'map-tests) | 324 | (provide 'map-tests) |
| 324 | ;;; map-tests.el ends here | 325 | ;;; map-tests.el ends here |