-
Notifications
You must be signed in to change notification settings - Fork 15
homework-08-ataranchiev #9
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
За исключением нескольких стилистических вопросов тесты написаны хорошо. Правильно используется макрос are
для написание тестов по шаблону. Очень здорово, что попробовал библиотеку matcher combinators. Спасибо за выполнение домашнего задание
; pretty useless I think | ||
(deftest test-header | ||
(is (= (header "Test") [:h2 {:style {:margin "8px 4px"}} "Test"]))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Думаю тест со значением nil
не был бы лишним.
(are [input expected] (= (id->int input) expected) | ||
"0" 0 | ||
"z" 61 | ||
"clj" 149031 | ||
"Clojure" 725410830262 | ||
"" 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я бы добавил тестов с некорректными аргументами. И сгруппировал все тесты на legal arguments
и illegal arguments
при помощи testing
{:uri "/", | ||
:request-method :post, | ||
:params | ||
{:url | ||
"https://github.com/Clojure-Developer/Clojure-Developer-2022-10"}} | ||
{:status 201, | ||
:headers {"Location" "1", | ||
"Content-Type" "application/json; charset=utf-8"}, | ||
:body "{\"id\":\"1\"}"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Неправильное форматирование. Зачем добавлять отступ, если это параметры одной функции?. Если хочешь их сгруппировать, то лучше добавь пустую строку между парами мап.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
я пользуюсь zprint как форматировщиком. Он сам все это делает автоматически. Я по сути код не форматирю.
"Content-Type" "application/json; charset=utf-8"}, | ||
:body "{\"id\":\"1\"}"} | ||
; Put clj | ||
{:uri "/clj", :request-method :put, :params {:url "https://clojure.org"}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ИМХО, каждую пару ключ-значение лучше помещать на отдельную строку. Аргументы в пользу такого code-style'а:
- Это препятствует появлению длинных строк.
- Это улучшает читаемость кода.
No description provided.