1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00
emacs/test/lisp/progmodes/c-ts-mode-resources/indent.erts
Yuan Fu 96ea27278b
; Fix c-ts-mode indent test
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: Move the linux
style test case down.
2023-02-02 18:32:08 -08:00

246 lines
2.7 KiB
Text

Code:
(lambda ()
(c-ts-mode)
(setq-local indent-tabs-mode nil)
(setq-local c-ts-mode-indent-offset 2)
(c-ts-mode-set-local-style 'gnu)
(indent-region (point-min) (point-max)))
Point-Char: |
Name: Basic
=-=
int
main (void)
{
return 0;
}
=-=-=
Name: Hanging Braces (GNU Style)
=-=
int
main (void)
{
if (true)
{
}
}
=-=-=
Name: Labels (GNU Style)
=-=
int
main (void)
{
label:
return 0;
if (true)
{
label:
return 0;
}
else
{
if (true)
{
label:
return 0;
}
}
}
=-=-=
Name: For Loop with Multi-line Condition (GNU Style)
=-=
int main()
{
for (int i = 0;
i < b;
i++)
{
return 0;
}
}
=-=-=
Name: If-Else (GNU Style)
=-=
int main()
{
if (true)
{
return 0;
}
else
{
return 1;
}
}
=-=-=
Name: Empty Line
=-=
int main()
{
|
}
=-=-=
Name: Concecutive blocks (GNU Style) (bug#60873)
=-=
int
main (int argc,
char *argv[])
{
{
int i = 0;
}
}
=-=-=
Name: Bracket-less Block-Statement (GNU Style) (bug#61026)
=-=
int main() {
while (true)
if (true)
{
puts ("Hello");
}
for (int i=0;
i<5;
i++)
if (true)
{
puts ("Hello");
}
do
if (true)
{
puts ("Hello");
}
while (true);
if (true)
if (true)
{
puts ("Hello");
}
}
=-=-=
Name: Multiline Parameter List (bug#60398)
=-=
int f2(int x,
int y) {
return x + y;
};
=-=-=
Name: Multiline Block Comments 1 (bug#60270)
=-=
/**
* @some_func:
* @arg1:
*/
=-=-=
Name: Multiline Block Comments 2 (bug#60270)
=-=
/*
some comment
*/
=-=-=
Name: Multiline Block Comments 3 (bug#60270)
=-=
/* some comment
*/
=-=-=
Name: Multiline Block Comments 4 (bug#60270)
=-=
/*
* Some comment
*/
=-=-=
Name: Multiline Block Comments 5 (bug#60270)
=-=
/*
line one
line 2
*/
=-=
/*
line one
line 2
*/
=-=-=
Code:
(lambda ()
(c-ts-mode)
(setq-local indent-tabs-mode nil)
(setq-local c-ts-mode-indent-offset 8)
(c-ts-mode-set-local-style 'linux)
(indent-region (point-min) (point-max)))
Name: Labels (Linux Style)
=-=-=
int main (void)
{
label:
return 0;
if (true) {
label:
return 0;
}
else {
if (true) {
label:
return 0;
}
}
}
=-=-=
Name: Bracket-less Block-Statement (Linux Style) (bug#61026)
=-=-=
int main() {
while (true)
if (true) {
puts ("Hello");
}
for (int i=0;
i<5;
i++)
if (true) {
puts ("Hello");
}
do
if (true) {
puts ("Hello");
}
while (true);
if (true)
if (true) {
puts ("Hello");
}
}
=-=-=