diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/services/configuration.scm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/services/configuration.scm b/tests/services/configuration.scm index 85badd2da6..86a36a388d 100644 --- a/tests/services/configuration.scm +++ b/tests/services/configuration.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com> +;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz> ;;; ;;; This file is part of GNU Guix. ;;; @@ -82,6 +83,17 @@ (let ((config (serializable-configuration))) (serialize-configuration config serializable-configuration-fields))))) +(define (custom-prefix-serialize-integer field-name name) name) + +(define-configuration configuration-with-prefix + (port (integer 10) "The port number.") + (prefix custom-prefix-)) + +(test-assert "serialize-configuration with prefix" + (gexp? + (let ((config (configuration-with-prefix))) + (serialize-configuration config configuration-with-prefix-fields)))) + ;;; ;;; define-maybe macro. |