Subject: bug#70345: [PATCH] 29.1.50; csharp-ts-mode indentation of if statements with single-statement body

From: john muhl <[email-masked]>
Date: Sat, 27 Apr 2024 08:10:47 -0500

Eli Zaretskii <[email-masked]> writes:

>> Cc: [email-masked], Jacob Leeming <[email-masked]>
>> From: Jacob Leeming <[email-masked]>
>> Date: Mon, 22 Apr 2024 09:50:23 +0100
>> 
>> > Looks good to me. Are you willing to pack this up with a nice test
>> > confirming the behavior?
>> >
>> > All the best,
>> > Theo
>> 
>> Thanks all,
>> 
>> Discovered we had a similar issue for else blocks. Wrote a test that
>> covers both cases.
>> 
>> See the attached diff which contains my changes to the indent rules and
>> the test.
>
> Thanks, I installed this on the emacs-29 branch.  (The test you added
> should have been added to csharp-mode-tests.el, since our test files
> follow the names of the implementation files, and csharp-ts-mode is
> implemented in csharp-mode.el.  I fixed that.)

The test should check that the c-sharp grammar is available so
that it gets marked as skipped instead of failed.

>From 068cad8612c31cea41f0cc21a865efe0785d4e7a Mon Sep 17 00:00:00 2001
From: john muhl <[email-masked]>
Date: Sat, 27 Apr 2024 09:55:42 -0500
Subject: [PATCH] ; Skip 'csharp-ts-mode' test if grammar is missing

* test/lisp/progmodes/csharp-mode-tests.el
(csharp-ts-mode-test-indentation): Skip test instead of failing.
---
 test/lisp/progmodes/csharp-mode-tests.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/test/lisp/progmodes/csharp-mode-tests.el b/test/lisp/progmodes/csharp-mode-tests.el
index 2878fa601f2..b3c57a7026b 100644
--- a/test/lisp/progmodes/csharp-mode-tests.el
+++ b/test/lisp/progmodes/csharp-mode-tests.el
@@ -27,6 +27,7 @@ csharp-mode-test-indentation
   (ert-test-erts-file (ert-resource-file "indent.erts")))
 
 (ert-deftest csharp-ts-mode-test-indentation ()
+  (skip-unless (treesit-ready-p 'c-sharp))
   (ert-test-erts-file (ert-resource-file "indent-ts.erts")))
 
 (provide 'csharp-mode-tests)
-- 
2.41.0