-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bba0734
commit 8b2cb71
Showing
5 changed files
with
102 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"methods": [ | ||
{ | ||
"name": "example", | ||
"params": [ | ||
{ | ||
"name": "name", | ||
"schema": | ||
{ | ||
"type": ["string", "null"], | ||
"maxLength": 255 | ||
}, | ||
"required": true, | ||
"summary": "User name." | ||
} | ||
], | ||
"result": { | ||
"name": "example_result", | ||
"schema": { | ||
"type": ["string", "null"], | ||
"maxLength": 255 | ||
} | ||
}, | ||
"summary": "Example method.", | ||
"paramStructure": "by-name" | ||
} | ||
], | ||
"openrpc": "1.0.0", | ||
"info": { | ||
"title": "Example API", | ||
"version": "0.1.0" | ||
}, | ||
"servers": [ | ||
{ | ||
"name": "default", | ||
"url": "https://example.org/" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
(uiop:define-package #:openrpc-tests/client/regression | ||
(:use #:cl) | ||
(:import-from #:rove | ||
#:deftest) | ||
(:import-from #:openrpc-client/core | ||
#:%generate-client | ||
#:retrieve-spec)) | ||
(in-package #:openrpc-tests/client/regression) | ||
|
||
|
||
(deftest client-regression () | ||
(let ((spec | ||
(rove:testing "Reading spec" | ||
(retrieve-spec | ||
;; TODO: repeat this test for all subfolders of #P"t/client" | ||
(asdf:system-relative-pathname :openrpc-tests | ||
(make-pathname :directory '(:relative "t" "client" "regress-data" "multiple-types") | ||
:name "spec" | ||
:type "json")))))) | ||
(rove:ok spec) | ||
|
||
(multiple-value-bind (client-class class-definitions methods) | ||
(rove:testing "Generating client" | ||
(%generate-client 'the-class spec :export-symbols nil)) | ||
|
||
;; TODO: Here we need to compare results with forms read from: | ||
;; - #P"t/client/regress-data/multiple-types/client-class.lisp" | ||
;; - #P"t/client/regress-data/multiple-types/class-definitions.lisp" | ||
;; - #P"t/client/regress-data/multiple-types/methods.lisp" | ||
(rove:ok client-class) | ||
(rove:ok class-definitions) | ||
(rove:ok methods)))) |