Skip to content

Commit

Permalink
add generator and regenerate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tasxatzial committed Jan 30, 2025
1 parent 0f356b0 commit ab052d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions exercises/practice/matching-brackets/.meta/generator.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(ns matching-brackets-test
(:require [clojure.test :refer [deftest testing is]]
matching-brackets))

{{#test_cases.isPaired}}
(deftest valid?_test_{{idx}}
(testing {{description}}
(is ({{#expected}}true?{{else}}false?{{/expected}} (matching-brackets/valid? {{input.value}})))))
{{/test_cases.isPaired}}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
(deftest valid?_test_11
(testing "unopened closing brackets"
(is (false? (matching-brackets/valid? "{[)][]}")))))

(deftest valid?_test_12
(testing "unpaired and nested brackets"
(is (false? (matching-brackets/valid? "([{])")))))
Expand Down Expand Up @@ -80,4 +80,4 @@

(deftest valid?_test_20
(testing "complex latex expression"
(is (true? (matching-brackets/valid? "\\\\left(\\\\begin{array}{cc} \\\\frac{1}{3} & x\\\\\\\\ \\\\mathrm{e}^{x} &... x^2 \\\\end{array}\\\\right)")))))
(is (true? (matching-brackets/valid? "\\left(\\begin{array}{cc} \\frac{1}{3} & x\\\\ \\mathrm{e}^{x} &... x^2 \\end{array}\\right)")))))

0 comments on commit ab052d3

Please sign in to comment.