gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet-scheme] 02/03: data-string: Test it.


From: gnunet
Subject: [gnunet-scheme] 02/03: data-string: Test it.
Date: Thu, 28 Jul 2022 18:59:43 +0200

This is an automated email from the git hooks/post-receive script.

maxime-devos pushed a commit to branch master
in repository gnunet-scheme.

commit b2deac7cc71d4f81d5543ca99fd30ddb7d26f183
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Thu Jul 28 18:56:25 2022 +0200

    data-string: Test it.
    
    * tests/data-string.scm: New test file.
    * Makefile.am (SCM_TESTS): Register new test file.
---
 Makefile.am           |  1 +
 tests/data-string.scm | 31 +++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index 2346ed3..34a4c0a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -181,6 +181,7 @@ SCM_LOG_DRIVER = \
     $(top_srcdir)/build-aux/test-driver.scm
 
 SCM_TESTS = \
+  tests/data-string.scm \
   tests/envelope.scm \
   tests/error-reporting.scm \
   tests/message-handler.scm \
diff --git a/tests/data-string.scm b/tests/data-string.scm
new file mode 100644
index 0000000..e7b6439
--- /dev/null
+++ b/tests/data-string.scm
@@ -0,0 +1,31 @@
+;;   This file is part of scheme-GNUnet, a partial Scheme port of GNUnet.
+;;   Copyright (C) 2022 GNUnet e.V.
+;;
+;;   scheme-GNUnet is free software: you can redistribute it and/or modify it
+;;   under the terms of the GNU Affero General Public License as published
+;;   by the Free Software Foundation, either version 3 of the License,
+;;   or (at your option) any later version.
+;;
+;;   scheme-GNUnet is distributed in the hope that it will be useful, but
+;;   WITHOUT ANY WARRANTY; without even the implied warranty of
+;;   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;;   Affero General Public License for more details.
+;;
+;;   You should have received a copy of the GNU Affero General Public License
+;;   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+;;
+;;   SPDX-License-Identifier: AGPL-3.0-or-later
+
+(import (gnu gnunet data-string)
+       (quickcheck arbitrary)
+       (quickcheck property)
+       (quickcheck)
+       (rnrs bytevectors)
+       (srfi srfi-64))
+
+;; TODO: test errors
+(test-assert
+ "data->string + string->data round-trips"
+ (quickcheck
+  (property ((data $bytevector))
+           (equal? data (string->data (data->string data) (bytevector-length 
data))))))

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]