Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some tests are failed on ABCL #14

Open
catap opened this issue Dec 7, 2023 · 5 comments
Open

Some tests are failed on ABCL #14

catap opened this issue Dec 7, 2023 · 5 comments

Comments

@catap
Copy link

catap commented Dec 7, 2023

:info:test ------- STARTING Testing: NJSON/TESTS 
:info:test Starting: NJSON/TESTS::JSON-LITERALS
:info:test NJSON/TESTS::JSON-LITERALS - ERRORS (0.04s) : 1 assertions passed
:info:test   | ERRORS (3)
:info:test   | ERROR: DECODE-FROM-STREAM is not specialized.
:info:test   | You need to specialize it to use NJSON. Example:
:info:test   | 
:info:test   | (defmethod njson:decode-from-stream ((stream stream))
:info:test   |   (some-json-parsing-library:decode-json-from-stream stream))
:info:test   | 
:info:test   | Alternatively, load a system with this method already defined, like :njson/cl-json.
:info:test   | #<NJSON:DECODE-FROM-STREAM-NOT-IMPLEMENTED {4BAC6B4B}>
:info:test   | ERROR: DECODE-FROM-STREAM is not specialized.
:info:test   | You need to specialize it to use NJSON. Example:
:info:test   | 
:info:test   | (defmethod njson:decode-from-stream ((stream stream))
:info:test   |   (some-json-parsing-library:decode-json-from-stream stream))
:info:test   | 
:info:test   | Alternatively, load a system with this method already defined, like :njson/cl-json.
:info:test   | #<NJSON:DECODE-FROM-STREAM-NOT-IMPLEMENTED {7B61EBF8}>
:info:test   | ERROR: DECODE-FROM-STREAM is not specialized.
:info:test   | You need to specialize it to use NJSON. Example:
:info:test   | 
:info:test   | (defmethod njson:decode-from-stream ((stream stream))
:info:test   |   (some-json-parsing-library:decode-json-from-stream stream))
:info:test   | 
:info:test   | Alternatively, load a system with this method already defined, like :njson/cl-json.
:info:test   | #<NJSON:DECODE-FROM-STREAM-NOT-IMPLEMENTED {735C2C07}>
:info:test   |
:info:test   | FAILED (2)
:info:test   | Failed Form: (LISP-UNIT2:ASSERT-EQ :NULL (NJSON:DECODE "null"))
:info:test   | Expected :NULL
:info:test   | but saw NIL
:info:test   | Failed Form: (LISP-UNIT2:ASSERT-EQ T (NJSON:DECODE "true"))
:info:test   | Expected T
:info:test   | but saw NIL
:info:test   |
:info:test   |
:info:test Starting: NJSON/TESTS::JSON-ATOMS
:info:test NJSON/TESTS::JSON-ATOMS - ERRORS (0.05s) : 0 assertions passed
:info:test   | ERRORS (5)
:info:test   | ERROR: DECODE-FROM-STREAM is not specialized.
:info:test   | You need to specialize it to use NJSON. Example:
:info:test   | 
:info:test   | (defmethod njson:decode-from-stream ((stream stream))
:info:test   |   (some-json-parsing-library:decode-json-from-stream stream))
:info:test   | 
:info:test   | Alternatively, load a system with this method already defined, like :njson/cl-json.
:info:test   | #<NJSON:DECODE-FROM-STREAM-NOT-IMPLEMENTED {5C35D598}>
:info:test   | ERROR: DECODE-FROM-STREAM is not specialized.
:info:test   | You need to specialize it to use NJSON. Example:
:info:test   | 
:info:test   | (defmethod njson:decode-from-stream ((stream stream))
:info:test   |   (some-json-parsing-library:decode-json-from-stream stream))
:info:test   | 
:info:test   | Alternatively, load a system with this method already defined, like :njson/cl-json.
:info:test   | #<NJSON:DECODE-FROM-STREAM-NOT-IMPLEMENTED {1A8875A2}>
:info:test   | ERROR: DECODE-FROM-STREAM is not specialized.
:info:test   | You need to specialize it to use NJSON. Example:
:info:test   | 
:info:test   | (defmethod njson:decode-from-stream ((stream stream))
:info:test   |   (some-json-parsing-library:decode-json-from-stream stream))
:info:test   | 
:info:test   | Alternatively, load a system with this method already defined, like :njson/cl-json.
:info:test   | #<NJSON:DECODE-FROM-STREAM-NOT-IMPLEMENTED {47774009}>
:info:test   | ERROR: DECODE-FROM-STREAM is not specialized.
:info:test   | You need to specialize it to use NJSON. Example:
:info:test   | 
:info:test   | (defmethod njson:decode-from-stream ((stream stream))
:info:test   |   (some-json-parsing-library:decode-json-from-stream stream))
:info:test   | 
:info:test   | Alternatively, load a system with this method already defined, like :njson/cl-json.
:info:test   | #<NJSON:DECODE-FROM-STREAM-NOT-IMPLEMENTED {4B7309F3}>
:info:test   | ERROR: DECODE-FROM-STREAM is not specialized.
:info:test   | You need to specialize it to use NJSON. Example:
:info:test   | 
:info:test   | (defmethod njson:decode-from-stream ((stream stream))
:info:test   |   (some-json-parsing-library:decode-json-from-stream stream))
:info:test   | 
:info:test   | Alternatively, load a system with this method already defined, like :njson/cl-json.
:info:test   | #<NJSON:DECODE-FROM-STREAM-NOT-IMPLEMENTED {39189C10}>
:info:test   |
:info:test   | FAILED (5)
:info:test   | Failed Form: (LISP-UNIT2:ASSERT-EQUAL 5 (NJSON:DECODE "5"))
:info:test   | Expected 5
:info:test   | but saw NIL
:info:test   | Failed Form: ('LISP-UNIT2::EQUAL-RESULT 5.5 (NJSON:DECODE "5.5"))
:info:test   | Expected 5.5
:info:test   | but saw NIL
:info:test   | Failed Form: ('LISP-UNIT2::EQUAL-RESULT -885.5
:info:test   |               (NJSON:DECODE "-885.5"))
:info:test   | Expected -885.5
:info:test   | but saw NIL
:info:test   | Failed Form: (LISP-UNIT2:ASSERT-EQUAL "foo32348hjvn"
:info:test   |                                       (NJSON:DECODE "\"foo32348hjvn\""))
:info:test   | Expected "foo32348hjvn"
:info:test   | but saw NIL
:info:test   | Failed Form: (LISP-UNIT2:ASSERT-EQUAL "" (NJSON:DECODE "\"\""))
:info:test   | Expected ""
:info:test   | but saw NIL
:info:test   |
:info:test   |
:info:test Starting: NJSON/TESTS::TRICKY-VALUES
:info:test NJSON/TESTS::TRICKY-VALUES - ERRORS (0.05s) : 0 assertions passed
:info:test   | ERRORS (3)
:info:test   | ERROR: DECODE-FROM-STREAM is not specialized.
:info:test   | You need to specialize it to use NJSON. Example:
:info:test   | 
:info:test   | (defmethod njson:decode-from-stream ((stream stream))
:info:test   |   (some-json-parsing-library:decode-json-from-stream stream))
:info:test   | 
:info:test   | Alternatively, load a system with this method already defined, like :njson/cl-json.
:info:test   | #<NJSON:DECODE-FROM-STREAM-NOT-IMPLEMENTED {4834686F}>
:info:test   | ERROR: DECODE-FROM-STREAM is not specialized.
:info:test   | You need to specialize it to use NJSON. Example:
:info:test   | 
:info:test   | (defmethod njson:decode-from-stream ((stream stream))
:info:test   |   (some-json-parsing-library:decode-json-from-stream stream))
:info:test   | 
:info:test   | Alternatively, load a system with this method already defined, like :njson/cl-json.
:info:test   | #<NJSON:DECODE-FROM-STREAM-NOT-IMPLEMENTED {415AF4B6}>
:info:test   | ERROR: The value NIL is not of type HASH-TABLE.
:info:test   | #<TYPE-ERROR {6F7345C1}>
:info:test   |
:info:test   | FAILED (1)
:info:test   | Failed Form: (LISP-UNIT2:ASSERT-TYPEP 'HASH-TABLE
:info:test   |                                       (NJSON:DECODE "{}"))
:info:test   | Expected HASH-TABLE
:info:test   | but saw NIL
:info:test   |
:info:test   |
:info:test Test Summary for :NJSON/TESTS (12 tests 0.16 sec)
:info:test   | 9 assertions total
:info:test   | 1 passed
:info:test   | 8 failed
:info:test   | 3 execution errors
:info:test   | 0 warnings
:info:test   | 0 empty
:info:test   | 0 missing tests
:info:test -------   ENDING Testing: NJSON/TESTS 
:info:test ; Compilation unit finished
:info:test ;   Caught 6 WARNING conditions
:info:test ;   Caught 9 STYLE-WARNING conditions
:info:test Caught TYPE-ERROR while processing --eval option "(asdf:operate (quote asdf:test-op) (quote njson))":
:info:test   The value NIL is not of type HASH-TABLE.
@aadcg
Copy link
Member

aadcg commented Dec 7, 2023

The log provides information on how to solve it - Alternatively, load a system with this method already defined, like :njson/cl-json.

In other words, you can load either njson/cl-json or njson/jzon and then test njson.

See 15609c2.

@aadcg aadcg closed this as completed Dec 7, 2023
@catap
Copy link
Author

catap commented Dec 7, 2023

@aadcg but this way works on SBCL, ECL, CLisp and CCL. And fails only on ABCL. From my point of view it should be consistent: does or does not work on all of them in the same way.

@aadcg
Copy link
Member

aadcg commented Dec 8, 2023

Are you sure about this claim? I just tested with SBCL by running (asdf:test-system :njson) from a clean image and got the output below.

------- STARTING Testing: NJSON/TESTS 

Starting: NJSON/TESTS::JSON-LITERALS
NJSON/TESTS::JSON-LITERALS - ERRORS (0.01s) : 0 assertions passed
  | ERRORS (1)
  | ERROR: DECODE-FROM-STREAM is not specialized.
  | You need to specialize it to use NJSON. Example:
  | 
  | (defmethod njson:decode-from-stream ((stream stream))
  |   (some-json-parsing-library:decode-json-from-stream stream))
  | 
  | Alternatively, load a system with this method already defined, like :njson/cl-json.
  | #<NJSON:DECODE-FROM-STREAM-NOT-IMPLEMENTED {10075C5F63}>
  |
  |
Starting: NJSON/TESTS::JSON-ATOMS
NJSON/TESTS::JSON-ATOMS - ERRORS (0.01s) : 0 assertions passed
  | ERRORS (1)
  | ERROR: DECODE-FROM-STREAM is not specialized.
  | You need to specialize it to use NJSON. Example:
  | 
  | (defmethod njson:decode-from-stream ((stream stream))
  |   (some-json-parsing-library:decode-json-from-stream stream))
  | 
  | Alternatively, load a system with this method already defined, like :njson/cl-json.
  | #<NJSON:DECODE-FROM-STREAM-NOT-IMPLEMENTED {100773FD63}>
  |
  |
Starting: NJSON/TESTS::TRICKY-VALUES
NJSON/TESTS::TRICKY-VALUES - ERRORS (0.01s) : 0 assertions passed
  | ERRORS (1)
  | ERROR: DECODE-FROM-STREAM is not specialized.
  | You need to specialize it to use NJSON. Example:
  | 
  | (defmethod njson:decode-from-stream ((stream stream))
  |   (some-json-parsing-library:decode-json-from-stream stream))
  | 
  | Alternatively, load a system with this method already defined, like :njson/cl-json.
  | #<NJSON:DECODE-FROM-STREAM-NOT-IMPLEMENTED {1007847E13}>
  |
  |
Starting: NJSON/TESTS::ALLOW-JSON-COMMENTS
NJSON/TESTS::ALLOW-JSON-COMMENTS - ERRORS (0.01s) : 0 assertions passed
  | ERRORS (1)
  | ERROR: DECODE-FROM-STREAM is not specialized.
  | You need to specialize it to use NJSON. Example:
  | 
  | (defmethod njson:decode-from-stream ((stream stream))
  |   (some-json-parsing-library:decode-json-from-stream stream))
  | 
  | Alternatively, load a system with this method already defined, like :njson/cl-json.
  | #<NJSON:DECODE-FROM-STREAM-NOT-IMPLEMENTED {1007AB7993}>
  |
  |
Starting: NJSON/TESTS::FROM-FILE
NJSON/TESTS::FROM-FILE - ERRORS (0.04s) : 0 assertions passed
  | ERRORS (1)
  | ERROR: DECODE-FROM-STREAM is not specialized.
  | You need to specialize it to use NJSON. Example:
  | 
  | (defmethod njson:decode-from-stream ((stream stream))
  |   (some-json-parsing-library:decode-json-from-stream stream))
  | 
  | Alternatively, load a system with this method already defined, like :njson/cl-json.
  | #<NJSON:DECODE-FROM-STREAM-NOT-IMPLEMENTED {100803B103}>
  |
  |
Starting: NJSON/TESTS::JCOPY-TEST
NJSON/TESTS::JCOPY-TEST - PASSED (0.03s) : 9 assertions passed

Starting: NJSON/TESTS::JGET-JSON-POINTER
NJSON/TESTS::JGET-JSON-POINTER - ERRORS (0.01s) : 0 assertions passed
  | ERRORS (1)
  | ERROR: DECODE-FROM-STREAM is not specialized.
  | You need to specialize it to use NJSON. Example:
  | 
  | (defmethod njson:decode-from-stream ((stream stream))
  |   (some-json-parsing-library:decode-json-from-stream stream))
  | 
  | Alternatively, load a system with this method already defined, like :njson/cl-json.
  | #<NJSON:DECODE-FROM-STREAM-NOT-IMPLEMENTED {10088E9483}>
  |
  |
Starting: NJSON/TESTS::JGET-ERRORS
NJSON/TESTS::JGET-ERRORS - ERRORS (0.03s) : 0 assertions passed
  | ERRORS (1)
  | ERROR: DECODE-FROM-STREAM is not specialized.
  | You need to specialize it to use NJSON. Example:
  | 
  | (defmethod njson:decode-from-stream ((stream stream))
  |   (some-json-parsing-library:decode-json-from-stream stream))
  | 
  | Alternatively, load a system with this method already defined, like :njson/cl-json.
  | #<NJSON:DECODE-FROM-STREAM-NOT-IMPLEMENTED {1009010C23}>
  |
  |
Starting: NJSON/TESTS::SETF-JGET-ERRORS
NJSON/TESTS::SETF-JGET-ERRORS - ERRORS (0.02s) : 0 assertions passed
  | ERRORS (1)
  | ERROR: DECODE-FROM-STREAM is not specialized.
  | You need to specialize it to use NJSON. Example:
  | 
  | (defmethod njson:decode-from-stream ((stream stream))
  |   (some-json-parsing-library:decode-json-from-stream stream))
  | 
  | Alternatively, load a system with this method already defined, like :njson/cl-json.
  | #<NJSON:DECODE-FROM-STREAM-NOT-IMPLEMENTED {10094F68A3}>
  |
  |
Starting: NJSON/TESTS::KEYS
NJSON/TESTS::KEYS - ERRORS (0.01s) : 0 assertions passed
  | ERRORS (1)
  | ERROR: DECODE-FROM-STREAM is not specialized.
  | You need to specialize it to use NJSON. Example:
  | 
  | (defmethod njson:decode-from-stream ((stream stream))
  |   (some-json-parsing-library:decode-json-from-stream stream))
  | 
  | Alternatively, load a system with this method already defined, like :njson/cl-json.
  | #<NJSON:DECODE-FROM-STREAM-NOT-IMPLEMENTED {1009796283}>
  |
  |
Starting: NJSON/TESTS::ENSURE
NJSON/TESTS::ENSURE - ERRORS (0.03s) : 8 assertions passed
  | ERRORS (1)
  | ERROR: DECODE-FROM-STREAM is not specialized.
  | You need to specialize it to use NJSON. Example:
  | 
  | (defmethod njson:decode-from-stream ((stream stream))
  |   (some-json-parsing-library:decode-json-from-stream stream))
  | 
  | Alternatively, load a system with this method already defined, like :njson/cl-json.
  | #<NJSON:DECODE-FROM-STREAM-NOT-IMPLEMENTED {1009D34E33}>
  |
  |
Starting: NJSON/TESTS::JBIND-PATTERNS
NJSON/TESTS::JBIND-PATTERNS - ERRORS (0.27s) : 0 assertions passed
  | ERRORS (1)
  | ERROR: DECODE-FROM-STREAM is not specialized.
  | You need to specialize it to use NJSON. Example:
  | 
  | (defmethod njson:decode-from-stream ((stream stream))
  |   (some-json-parsing-library:decode-json-from-stream stream))
  | 
  | Alternatively, load a system with this method already defined, like :njson/cl-json.
  | #<NJSON:DECODE-FROM-STREAM-NOT-IMPLEMENTED {1003B955F3}>
  |
  |
Test Summary for :NJSON/TESTS (12 tests 0.49 sec)
  | 17 assertions total
  | 17 passed
  | 0 failed
  | 11 execution errors
  | 0 warnings
  | 0 empty
  | 0 missing tests

-------   ENDING Testing: NJSON/TESTS 

; file: /gnu/store/ylcj7ryf14v8gbrm5f073kz565fkxaqj-cl-lisp-unit2-0.9.4-0.b5aa17b/share/common-lisp/source/cl-lisp-unit2/summarize.lisp
; in: DEFUN LISP-UNIT2:WITH-TEST-RESULTS-CONTEXT
;     (LISP-UNIT2::DO-CONTEXTS LISP-UNIT2::BODY-FN
;                              LISP-UNIT2::+INTEROP-TEST-RESULT-CONTEXTS+)
; 
; caught WARNING:
;   undefined variable: LISP-UNIT2::+INTEROP-TEST-RESULT-CONTEXTS+
; 
; compilation unit finished
;   Undefined variable:
;     LISP-UNIT2::+INTEROP-TEST-RESULT-CONTEXTS+
;   caught 1 WARNING condition
;   caught 1 STYLE-WARNING condition
;   printed 1 note
T

@aadcg
Copy link
Member

aadcg commented Dec 8, 2023

If you ask for my personal opinion, I find this system architecture odd too. I'm just echoing its original intent.

@aadcg
Copy link
Member

aadcg commented Dec 8, 2023

Ok, I have now understood your concern, sorry!

The issue is that ABCL actually evaluates (assert-typep 'hash-table (decode "{}")) and errors, unlike other implementations. It seems like an ABCL bug, since it should catch the signal decode-from-stream-not-implemented.

@aadcg aadcg reopened this Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants