Skip to content

Conversation

ewok
Copy link

@ewok ewok commented Jul 28, 2024

No description provided.

Copy link
Contributor

@XOMAv2 XOMAv2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

За исключением нескольких стилистических вопросов тесты написаны хорошо. Правильно используется макрос are для написание тестов по шаблону. Очень здорово, что попробовал библиотеку matcher combinators. Спасибо за выполнение домашнего задание

Comment on lines +5 to +7
; pretty useless I think
(deftest test-header
(is (= (header "Test") [:h2 {:style {:margin "8px 4px"}} "Test"])))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Думаю тест со значением nil не был бы лишним.

Comment on lines +28 to +33
(are [input expected] (= (id->int input) expected)
"0" 0
"z" 61
"clj" 149031
"Clojure" 725410830262
"" 0))
Copy link
Contributor

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

Comment on lines +13 to +21
{: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\"}"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Неправильное форматирование. Зачем добавлять отступ, если это параметры одной функции?. Если хочешь их сгруппировать, то лучше добавь пустую строку между парами мап.

Copy link
Author

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"}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ИМХО, каждую пару ключ-значение лучше помещать на отдельную строку. Аргументы в пользу такого code-style'а:

  1. Это препятствует появлению длинных строк.
  2. Это улучшает читаемость кода.

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

Successfully merging this pull request may close these issues.

2 participants