From 50a3d59473acf9fb5e771b57528b09d3e66123c4 Mon Sep 17 00:00:00 2001 From: 宋文武 Date: Wed, 6 Apr 2016 17:35:13 +0800 Subject: utils: Add 'edit-expression'. * guix/utils.scm (edit-expression): New procedure. * tests/utils.scm (edit-expression): New test. --- tests/utils.scm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') diff --git a/tests/utils.scm b/tests/utils.scm index 6b7725554f..d0ee02a1cf 100644 --- a/tests/utils.scm +++ b/tests/utils.scm @@ -333,6 +333,19 @@ "This is a journey\r\nInto the sound\r\nA journey ...\n"))) (get-string-all (canonical-newline-port port)))) + +(test-equal "edit-expression" + "(display \"GNU Guix\")\n(newline)\n" + (begin + (call-with-output-file temp-file + (lambda (port) + (display "(display \"xiuG UNG\")\n(newline)\n" port))) + (edit-expression `((filename . ,temp-file) + (line . 0) + (column . 9)) + string-reverse) + (call-with-input-file temp-file get-string-all))) + (test-end) (false-if-exception (delete-file temp-file)) -- cgit v1.2.3