summaryrefslogtreecommitdiff
path: root/tests/import/cran.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tests/import/cran.scm')
-rw-r--r--tests/import/cran.scm19
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/import/cran.scm b/tests/import/cran.scm
index 5c820b1ab32..6b1bcc297dd 100644
--- a/tests/import/cran.scm
+++ b/tests/import/cran.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> 2;;; Copyright © 2015, 2025 Ricardo Wurmus <rekado@elephly.net>
3;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com> 3;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
4;;; 4;;;
5;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
@@ -20,6 +20,7 @@
20(define-module (test-cran) 20(define-module (test-cran)
21 #:use-module (gnu packages statistics) 21 #:use-module (gnu packages statistics)
22 #:use-module (guix import cran) 22 #:use-module (guix import cran)
23 #:use-module (guix sets)
23 #:use-module (guix tests) 24 #:use-module (guix tests)
24 #:use-module (srfi srfi-1) 25 #:use-module (srfi srfi-1)
25 #:use-module (srfi srfi-64) 26 #:use-module (srfi srfi-64)
@@ -88,7 +89,21 @@ Date/Publication: 2015-07-14 14:15:16
88 '() 89 '()
89 ((@@ (guix import cran) listify) simple-alist "BadList")) 90 ((@@ (guix import cran) listify) simple-alist "BadList"))
90 91
91(test-equal "r-mininal is not a cran package" 92(test-equal "extract-imports: finds data.table"
93 (list "data.table")
94 (set->list ((@ (guix import cran) extract-imports) "abc + data.table::some_procedure()")))
95
96(test-equal "extract-imports: ignores text inside strings"
97 (list)
98 (set->list ((@ (guix import cran) extract-imports)
99 "\"hello::world\", \"this is not data.table::some_procedure(), actually\"")))
100
101(test-equal "extract-imports: ignores other colon separated things"
102 (list)
103 (set->list ((@ (guix import cran) extract-imports)
104 "this:is:not::a:procedure")))
105
106(test-equal "r-minimal is not a cran package"
92 #f 107 #f
93 ((@@ (guix import cran) cran-package?) r-minimal)) 108 ((@@ (guix import cran) cran-package?) r-minimal))
94 109