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

Test suite update #13

Open
Kurvivor19 opened this issue Sep 27, 2017 · 0 comments
Open

Test suite update #13

Kurvivor19 opened this issue Sep 27, 2017 · 0 comments

Comments

@Kurvivor19
Copy link
Contributor

Currently test suite for parinfer makes certain assumptions about test data, as expressed here:

(defun run-test (mode test)
(let* ((mode-string (if (equal :indent mode) "Indent Mode" "Paren Mode"))
(in (plist-get test :in))
(out (plist-get test :out))
(out-cursor (plist-get out :cursor))
(out-error (plist-get out :error))
(out-tabstops (plist-get out :tabStops))
(test-id (number-to-string (plist-get in :fileLineNo)))
(in-text (string-join (plist-get in :lines)))
(expected-text (string-join (plist-get out :lines)))
(in-cursor (plist-get in :cursor))
(cursor-x (plist-get in-cursor :cursorX))
(cursor-line (plist-get in-cursor :cursorLine))
(cursor-dx (plist-get in-cursor :cursorDx))

However, in test cases, data structure does not have those fields listed, for example:

{
"in": {
"fileLineNo": 927,
"text": "(let [a {:foo 1}\n bar [1 2 3]]\n |\n bar)"
},
"out": {
"fileLineNo": 934,
"text": "(let [a {:foo 1}\n bar [1 2 3]]\n^ ^ ^ tabStops\n |\n bar)"
}

Instead cursor position, tab stops, last changes (for smart mode) are described in text, on specially formatted lines

For proper test running, it is necessary to update test suite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant