Skip to content

Commit

Permalink
Merge pull request armedbear#154 from easye/easye/20200319a
Browse files Browse the repository at this point in the history
Easye/20200319a
  • Loading branch information
easye authored Mar 19, 2020
2 parents c05f028 + da1fd76 commit 8b8572a
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 83 deletions.
5 changes: 3 additions & 2 deletions ci/ensure-jenv-is-present.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export JENV_ROOT=$HOME/.jenv
if [[ $(echo $PATH | grep -c .jenv) -eq 0 ]]; then
export PATH="$HOME/.jenv/bin:$PATH"
export PATH="$JENV_ROOT/bin:$PATH"
fi

eval "$(jenv init -)"

eval "$(jenv enable-plugin export)"
16 changes: 8 additions & 8 deletions ci/install-adoptjdk.bash
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ function determine_adoptjdk() {
Darwin)
case $jdk in
openjdk8)
topdir=jdk8u232-b09
dist="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09/OpenJDK8U-jdk_x64_mac_hotspot_8u232b09.tar.gz"
topdir=jdk8u242-b08
dist="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jdk_x64_mac_hotspot_8u242b08.tar.gz"
;;
openjdk11)
topdir=jdk-11.0.5+10
dist="https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.5%2B10/OpenJDK11U-jdk_x64_mac_hotspot_11.0.5_10.tar.gz"
topdir=jdk-11.0.6+10
dist="https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10/OpenJDK11U-jdk_x64_mac_hotspot_11.0.6_10.tar.gz"
;;
esac
;;
Linux)
case $jdk in
openjdk8)
topdir=jdk8u232-b09
dist="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/${topdir}/OpenJDK8U-jdk_x64_linux_hotspot_8u232b09.tar.gz"
topdir=jdk8u242-b08
dist="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u242b08.tar.gz"
;;
openjdk11)
topdir=jdk-11.0.5+10
dist="https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.5%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.5_10.tar.gz"
topdir=jdk-11.0.6+10
dist="https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.6_10.tar.gz"
;;
esac
;;
Expand Down
43 changes: 17 additions & 26 deletions contrib/abcl-asdf/maven.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -97,35 +97,26 @@ Emits warnings if not able to find a suitable executable."
(ensure-mvn-version))
(warn "M2 was set to '~A' in the process environment but '~A' doesn't exist."
m2 mvn-path))))
(let* ((which-cmd
(let ((which-cmd
(if (find :unix *features*)
"which"
;; Starting with Windows Server 2003
"where.exe"))
(which-cmd-p
(handler-case
(multiple-value-bind (output error)
(uiop:run-program which-cmd :output :string :error-output :string :ignore-error-status t)
(if (> (length error) 0)
t
nil))
(t () nil))))
(when which-cmd-p
(dolist (mvn-path *mavens*)
(let ((mvn
(handler-case
(truename
(string-trim
'(#\space #\newline #\return #\tab)
(uiop:run-program
(format nil "~a ~a" which-cmd mvn-path)
:output :string)))
(t (e)
(format cl:*load-verbose*
"~&; abcl-asdf; Failed to find Maven executable '~a' in PATH because~%~a"
mvn-path e)))))
(when mvn
(return-from find-mvn mvn))))))
"where.exe")))
(dolist (mvn-path *mavens*)
(let ((mvn
(handler-case
(truename
(string-trim
'(#\space #\newline #\return #\tab)
(uiop:run-program
(format nil "~a ~a" which-cmd mvn-path)
:output :string)))
(t (e)
(format cl:*load-verbose*
"~&; abcl-asdf; Failed to find Maven executable '~a' in PATH because~%~a"
mvn-path e)))))
(when mvn
(return-from find-mvn mvn)))))
(warn "Unable to locate Maven executable to find Maven Aether adaptors.")))

(defun find-mvn-libs ()
Expand Down
12 changes: 6 additions & 6 deletions t/decode-float.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
(let ((radix (float-radix float)))
(let ((lower (/ 1 radix)))
(prove:ok
(and (>= quotient lower)
(< quotient 1))
(format nil "Whether ~a is between ~a and 1…" quotient lower)))))))
(and (< quotient 1)
(>= quotient lower))
(format nil "Whether ~a lies within (1 ~a]" quotient lower)))))))

;;; <https://github.com/armedbear/abcl/issues/94>
(let ((floats `(,least-positive-normalized-double-float
Expand All @@ -31,9 +31,9 @@
(let ((radix (float-radix float)))
(let ((lower (/ 1 radix)))
(prove:ok
(and (>= quotient lower)
(< quotient 1))
(format nil "Whether ~a is between ~a and 1…" quotient lower)))))))
(and (< quotient 1)
(>= quotient lower))
(format nil "Whether ~a lies within (1 ~a]" quotient lower)))))))

;;; <https://github.com/armedbear/abcl/issues/95>
(let ((floats `(1d0 ,most-positive-double-float ,least-positive-double-float)))
Expand Down
82 changes: 41 additions & 41 deletions t/format-dollar.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -2,65 +2,65 @@

(prove:plan 15)

(prove:ok
(format t "~,vf" 3 -0.1768522)
"reported with -0.177 NIL")
(prove:is
(format nil "~,vf" 3 -0.1768522)
"-0.177") ;; sbcl

(prove:ok
(format t "~,vf" 2 -0.1768522)
"reported with -0.18 NIL")
(prove:is
(format nil "~,vf" 2 -0.1768522)
"-0.18")

(prove:ok
(format t "~,vf" 1 -0.1768522)
"reported with -0.2 NIL")
(prove:is
(format nil "~,vf" 1 -0.1768522)
"-0.2")

(prove:ok
(format t "~,vf" 0 -0.1768522)
"-0. NIL")
(prove:is
(format nil "~,vf" 0 -0.1768522)
"-0.")

(prove:ok
(format t "~$" -0.1768522)
"--1.6 NIL")
(prove:is
(format nil "~$" -0.1768522)
"-0.18")

(prove:ok
(format t "~v$" 3 -0.1768522)
"reported as --1.75 NIL")
(prove:is
(format nil "~v$" 3 -0.1768522)
"-0.177")

(prove:ok
(format t "~v$" 2 -0.1768522)
"--1.6 NIL")
(prove:is
(format nil "~v$" 2 -0.1768522)
"-0.18")

(prove:ok
(format t "~v$" 1 -0.1768522)
"reported type error: Array index out of bounds: 2")
(prove:is
(format nil "~v$" 1 -0.1768522)
"-0.2") ;; reported type error: Array index out of bounds:

(prove:ok
(format t "~v$" 0 -0.1768522)
"--0. NIL")
(prove:is
(format nil "~v$" 0 -0.1768522)
"-0.")

(prove:ok
(format t "~$" 0.1768522)
"0.18 NIL")
(prove:is
(format nil "~$" 0.1768522)
"0.18")

(prove:ok
(format t "~v$" 3 0.1768522)
"0.177 NIL")
(prove:is
(format nil "~v$" 3 0.1768522)
"0.177")

(prove:ok
(prove:is
(format nil "~v$" 2 0.1768522)
"0.18 NIL")
"0.18")

(prove:ok
(prove:is
(format nil "~v$" 1 0.1768522)
"0.2 NIL")
"0.2")

(prove:ok
(prove:is
(format nil "~v$" 0 0.1768522)
"0. NIL")
"0.")

;; dingd
(prove:ok
(prove:is
(format nil "~$" -0.0)
"-0.00")
"0.00") ;; sbcl

(prove:finalize)
21 changes: 21 additions & 0 deletions t/jcoerce-numerics.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
(in-package :cl-user)

(prove:plan 1)
(prove:isnt
(handler-case
(jcoerce 2.4 "double")
(error (e) (format *standard-output* "error: ~a~%" e)))
nil
"Coercing 2.4 to a double")

(let ((values '(2.44 -2.44)))
(prove:plan (length values))
(dolist (value values)
(prove:is
(= (#"doubleValue" (jcoerce value "double"))
value)
(format nil "JCOERCE ~a to a 'double'" value))))

(prove:finalize)


0 comments on commit 8b8572a

Please sign in to comment.