Skip to content

Commit 399f21a

Browse files
✅ Add AL codeunit test cases and update text issue counts
Added AL codeunit examples to test diffs and updated test_todo_parser.py to include AL-related tests, increasing the expected 'text' issue count from 16 to 19 in relevant test cases.
1 parent beac328 commit 399f21a

3 files changed

Lines changed: 57 additions & 4 deletions

File tree

tests/test_closed.diff

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,3 +600,30 @@ index d340f6a..29b54da 100644
600600
-labels: feature
601601
-#>
602602
Write-Host "Script completed"
603+
diff --git a/tests/ExampleCodeunit.al b/tests/ExampleCodeunit.al
604+
index a1b2c3d..5e6f7g8 100644
605+
--- a/tests/ExampleCodeunit.al
606+
+++ b/tests/ExampleCodeunit.al
607+
@@ -1,19 +1,12 @@
608+
codeunit 50100 "Example Codeunit"
609+
{
610+
- // TODO: Implement customer validation logic
611+
- // This needs to be done before go-live
612+
- // labels: enhancement
613+
614+
procedure ValidateCustomer(CustomerNo: Code[20])
615+
var
616+
Customer: Record Customer;
617+
begin
618+
- // TODO: Add validation rules
619+
- // We need to check credit limit and blocked status
620+
- // labels: urgent
621+
622+
- /*
623+
- TODO: Add error handling
624+
- labels: help wanted
625+
- */
626+
+ if Customer.Get(CustomerNo) then
627+
+ Customer.TestField(Blocked, Customer.Blocked::" ");
628+
end;
629+
}

tests/test_new.diff

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,3 +625,29 @@ index 0000000..d340f6a
625625
+labels: feature
626626
+#>
627627
+Write-Host "Script completed"
628+
diff --git a/ExampleCodeunit.al b/ExampleCodeunit.al
629+
new file mode 100644
630+
index 0000000..a1b2c3d
631+
--- /dev/null
632+
+++ b/ExampleCodeunit.al
633+
@@ -0,0 +1,19 @@
634+
+codeunit 50100 "Example Codeunit"
635+
+{
636+
+ // TODO: Implement customer validation logic
637+
+ // This needs to be done before go-live
638+
+ // labels: enhancement
639+
+
640+
+ procedure ValidateCustomer(CustomerNo: Code[20])
641+
+ var
642+
+ Customer: Record Customer;
643+
+ begin
644+
+ // TODO: Add validation rules
645+
+ // We need to check credit limit and blocked status
646+
+ // labels: urgent
647+
+
648+
+ /*
649+
+ TODO: Add error handling
650+
+ labels: help wanted
651+
+ */
652+
+ end;
653+
+}

tests/test_todo_parser.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ def test_handlebars_issues(self):
8989
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'handlebars'), 2)
9090

9191
def test_text_issues(self):
92-
# Includes 2 tests for Org, 2 tests for GAP, 2 tests for Visual Basic, 2 tests for Agda, 4 tests for Sol, 4 tests for Move
93-
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'text'), 16)
92+
# Includes 2 tests for Org, 2 tests for GAP, 2 tests for Visual Basic, 2 tests for Agda, 4 tests for Sol, 4 tests for Move, 3 tests for AL
93+
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'text'), 19)
9494

9595
def test_scss_issues(self):
9696
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'scss'), 2)
@@ -271,8 +271,8 @@ def test_handlebars_issues(self):
271271
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'handlebars'), 2)
272272

273273
def test_text_issues(self):
274-
# Includes 2 tests for Org, 2 tests for GAP, 2 tests for Visual Basic, 2 tests for Agda, 4 tests for Sol, 4 tests for Move
275-
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'text'), 16)
274+
# Includes 2 tests for Org, 2 tests for GAP, 2 tests for Visual Basic, 2 tests for Agda, 4 tests for Sol, 4 tests for Move, 3 tests for AL
275+
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'text'), 19)
276276

277277
def test_scss_issues(self):
278278
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'scss'), 2)

0 commit comments

Comments
 (0)