gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet-scheme] branch master updated (b5a95cf -> 1b75c50)


From: gnunet
Subject: [gnunet-scheme] branch master updated (b5a95cf -> 1b75c50)
Date: Sun, 28 Aug 2022 22:03:06 +0200

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

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

    from b5a95cf  tests/cadet: Test closing of CADET channels.
     new aa8a838  guix: Stop patching guile-fibers locally.
     new 534b6b2  tests/distributed-hash-table: Unskip test.
     new 64382a6  value-parser: Correct typo in docstring of value->float
     new 9deb75f  tests/config-value-parser: Test value->float of negative 
numbers.
     new 36b593b  tests/config-value-parser: Remove bogus skip.
     new e9e9b59  value-parser: Recognise negative floating-point numbers.
     new 1b75c50  value-parser: Distinguish -0 from +0 as floating point number.

The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 gnu/gnunet/config/value-parser.scm | 13 +++++++++----
 guix.scm                           | 12 ++----------
 tests/config-value-parser.scm      | 16 ++++++++++++++--
 tests/distributed-hash-table.scm   |  3 ---
 4 files changed, 25 insertions(+), 19 deletions(-)

diff --git a/gnu/gnunet/config/value-parser.scm 
b/gnu/gnunet/config/value-parser.scm
index a81b834..7cf4ce0 100644
--- a/gnu/gnunet/config/value-parser.scm
+++ b/gnu/gnunet/config/value-parser.scm
@@ -1,5 +1,5 @@
 ;; This file is part of scheme-GNUnet.
-;; Copyright (C) 2005-2021 GNUnet e.V.
+;; Copyright © 2005--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
@@ -97,15 +97,20 @@ In case of a parse error, raise an appropriate
          (raise (make-value-parse/natural-error text))
          (string->number text)))
 
+    ;; TODO: should +1.4 be accepted?
     (define float-regex
-      (make-regexp "^((0|[1-9][0-9]*)(\\.[0-9]*)?|\\.[0-9]+)$"))
+      (make-regexp "^(-)?((0|[1-9][0-9]*)(\\.[0-9]*)?|\\.[0-9]+)$"))
 
     (define (value->float text)
       "Parse @var{text} as a floating-point number.
 In case of a parse error, raise an appropriate
-@ code{&value-parse/float-error}."
+@code{&value-parse/float-error}."
       (if (regexp-exec float-regex text)
-         (exact->inexact (string->number text))
+         (if (string=? text "-0")
+             ;; The code below would return +0.0 instead,
+             ;; even though -0.0 is separate from +0.0 on IEEE.
+             -0.0
+             (exact->inexact (string->number text)))
          (raise (make-value-parse/float-error text))))
 
     (define (value->boolean text)
diff --git a/guix.scm b/guix.scm
index 59e544e..d05ce8c 100644
--- a/guix.scm
+++ b/guix.scm
@@ -37,14 +37,6 @@
 
 (define %source-dir (dirname (current-filename)))
 
-(define guile-fibers-1.1/fixed
-  (package
-   (inherit
-    (package-with-extra-patches
-     guile-fibers-1.1
-     (list (local-file "guile-fibers-epoll-instance-is-dead.patch"))))
-   (arguments (list #:tests? #false)))) ; long test times, not worth it
-
 (define-public scheme-gnunet
   (package
    (name "scheme-gnunet")
@@ -54,10 +46,10 @@
                       #:select? (git-predicate %source-dir)))
    (build-system gnu-build-system)
    (propagated-inputs
-    (list guile-zlib guile-bytestructures guile-fibers-1.1/fixed guile-gcrypt
+    (list guile-zlib guile-bytestructures guile-fibers-1.1 guile-gcrypt
          guile-json-4 guile-pfds))
    (native-inputs
-    (list guile-3.0-latest guile-gcrypt guile-fibers-1.1/fixed guile-json-4 
guile-pfds
+    (list guile-3.0-latest guile-gcrypt guile-fibers-1.1 guile-json-4 
guile-pfds
          automake
          ;; Only used for testing.
          guile-quickcheck
diff --git a/tests/config-value-parser.scm b/tests/config-value-parser.scm
index c440b7a..f8953d9 100644
--- a/tests/config-value-parser.scm
+++ b/tests/config-value-parser.scm
@@ -1,5 +1,5 @@
 ;; This file is part of scheme-GNUnet.
-;; Copyright (C) 2021 GNUnet e.V.
+;; Copyright © 2021--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
@@ -99,7 +99,6 @@
 ;;
 ;; In Guile 3.?, 0.0 and -0.0 are = but not eqv?.
 
-(test-skip (if (eqv? 0.0 -0.0) 1 0))
 (test-eqv "value->float, positive 0 (a)"
   0.0
   (value->float "0.0"))
@@ -113,6 +112,19 @@
   0.0
   (value->float "0"))
 
+(test-eqv "value->float, negative 0 (a)"
+  -0.0
+  (value->float "-0.0"))
+(test-eqv "value->float, negative 0 (b)"
+  -0.0
+  (value->float "-0."))
+(test-eqv "value->float, negative 0 (c)"
+  -0.0
+  (value->float "-.0"))
+(test-eqv "value->float, negative 0 (d)"
+  -0.0
+  (value->float "-0"))
+
 (test-equal "value->float, nothing before dot"
   (list 0.1 0.3 0.19 0.22)
   (map value->float '(".1" ".3" ".19" ".22")))
diff --git a/tests/distributed-hash-table.scm b/tests/distributed-hash-table.scm
index 0a98e85..9453873 100644
--- a/tests/distributed-hash-table.scm
+++ b/tests/distributed-hash-table.scm
@@ -763,9 +763,6 @@ supported.  When @var{explode} is signalled, the connection 
is closed."
      (wait done)
      #true)))
 
-;; TODO: would be nice to verify that the necessary messages are sent to the
-;; DHT service.  TODO: sometimes fails with ‘epoll instance is death’.
-(test-skip 1)
 (test-assert "cancelling a search within a search callback does not hang"
   (call-with-services/fibers
    `(("dht" . ,(simulate-dht-service)))

-- 
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]