Skip to content

Commit

Permalink
svelte: test new / closed todos
Browse files Browse the repository at this point in the history
  • Loading branch information
chadsr committed Aug 23, 2024
1 parent 3844e12 commit d51b2ca
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_closed.diff
Original file line number Diff line number Diff line change
Expand Up @@ -467,3 +467,25 @@ index 525e25d..ba4e68d 100644
-TODO: Create an issue for TODO
--}
-sum a b = a + b
diff --git a/tests/example.svelte b/tests/example.svelte
index 9457a5b..3844e12 100644
--- a/tests/example.svelte
+++ b/tests/example.svelte
+<script>
- // TODO export counter as prop
- let counter = 0;
+ export let counter = 0;
+
- /* TODO multiply counter by 10
- increaseCounter should return the current counter value multiplied by 10
- */
+ function increaseCounter(counter) {
- return counter + 1;
+ return counter * 10;
+ }
+
+ counter = increaseCounter(counter);
+</script>
+
+<!-- TODO style counter -->
+<p>{counter}</p>
21 changes: 21 additions & 0 deletions tests/test_new.diff
Original file line number Diff line number Diff line change
Expand Up @@ -525,3 +525,24 @@ index 0000000..0ce9b1a
+TODO: Create an issue for TODO
+-}
+sum a b = a + b
diff --git a/tests/example.svelte b/tests/example.svelte
new file mode 100644
index 0000000..3844e12
--- /dev/null
+++ b/tests/example.svelte
+<script>
+ // TODO export counter as prop
+ let counter = 0;
+
+ /* TODO multiply counter by 10
+ increaseCounter should return the current counter value multiplied by 10
+ */
+ function increaseCounter(counter) {
+ return counter + 1;
+ }
+
+ counter = increaseCounter(counter);
+</script>
+
+<!-- TODO style counter -->
+<p>{counter}</p>
5 changes: 5 additions & 0 deletions tests/test_todo_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ def test_c_cpp_like_issues(self):
def test_liquid_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'liquid'), 3)

def test_svelte_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'svelte'), 3)


class ClosedIssueTests(unittest.TestCase):
# Check for removed TODOs across the files specified.
Expand Down Expand Up @@ -188,6 +191,8 @@ def test_c_cpp_like_issues(self):
def test_liquid_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'liquid'), 3)

def test_svelte_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'svelte'), 3)

class IgnorePatternTests(unittest.TestCase):

Expand Down

0 comments on commit d51b2ca

Please sign in to comment.