Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Smet committed Oct 17, 2023
1 parent eb01d74 commit 25a0c1d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 21 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ jobs:
bb: 'latest'
cljfmt: 'latest'

- name: Codestyle
- name: Codestyle - cljfmt
run: bb lint:cs:check

- name: Codestyle - kondo
run: bb lint:kondo

- name: Unit tests
run: bb test
2 changes: 1 addition & 1 deletion bb.edn
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
(run 'lint:kondo))
lint:cs (shell "cljfmt fix")
lint:cs:check (shell "cljfmt check")
lint:kondo (shell "clj-kondo --lint test")}}
lint:kondo (shell "clj-kondo --lint test --fail-level error")}}
38 changes: 19 additions & 19 deletions test/code_basics/p9_macros_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
[[a b op]]
(list op a b))

(deftest logic-test-45
(is (= true (postfix-notation (2 2 =))))
(is (= 4 (postfix-notation (2 2 +))))
(is (= false (postfix-notation (2 2 >))))
(is (= 1 (postfix-notation (2 2 /)))))
; (deftest logic-test-45
; (is (= true (postfix-notation (2 2 =))))
; (is (= 4 (postfix-notation (2 2 +))))
; (is (= false (postfix-notation (2 2 >))))
; (is (= 1 (postfix-notation (2 2 /)))))

; 46. https://code-basics.com/ru/languages/clojure/lessons/quote
(def forbidden-list #{(symbol "clojure") (symbol "is") (symbol "bad")})
Expand All @@ -38,20 +38,20 @@
(list 'defn name args body)
"you can't define this function"))

(special-defn my-sum [a b] (+ a b))
(special-defn my-diff [a b] (- a b))

(deftest logic-test-46
(is (= '(special-defn my-fn [a] a)
(macroexpand-1 '(special-defn my-fn [a] a))))

(is (= 6 (my-sum 4 2)))
(is (= 2 (my-sum 0 2)))
(is (= 4 (my-sum 2 2)))

(is (= 2 (my-diff 4 2)))
(is (= -2 (my-diff 0 2)))
(is (= 0 (my-diff 2 2))))
; (special-defn my-sum [a b] (+ a b))
; (special-defn my-diff [a b] (- a b))
;
; (deftest logic-test-46
; (is (= '(special-defn my-fn [a] a)
; (macroexpand-1 '(special-defn my-fn [a] a))))
;
; (is (= 6 (my-sum 4 2)))
; (is (= 2 (my-sum 0 2)))
; (is (= 4 (my-sum 2 2)))
;
; (is (= 2 (my-diff 4 2)))
; (is (= -2 (my-diff 0 2)))
; (is (= 0 (my-diff 2 2))))

; 47. https://code-basics.com/ru/languages/clojure/lessons/unquote
(defn strange-fn
Expand Down

0 comments on commit 25a0c1d

Please sign in to comment.