Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
trdthg committed Jul 5, 2024
1 parent 5f5a769 commit 5444750
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/format/break_indent.sail
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
function f b = if b == bitone then bitzero else bitone
function f b = if b == bitone then { bitzero } else { bitone }
function f b = if b == bitone then { let a = 1;bitzero } else { bitone }

function f b = if b == bitone then { {bitzero } } else { bitone }
function f b = if b == bitone then { {{bitzero} } } else { bitone }
function f b = if b == bitone then { { let a = 1; bitzero } } else { bitone }
function f b = if b == bitone then { { {let a = 1; bitzero} } } else { bitone }
function f b = if b == bitone then { { { {let a = 1; bitzero}} } } else { {{{let a= 1; bitone}}} }
function f b = if b == bitone then { { { {let a = 1; bitzero}} } } else { {{bitone }}}
function f b = if b == bitone then { { { {let a = 1; bitzero}} } } else { {let a = 1;{bitone }}}

/* comment */
function/* comment */f b = if b == bitone then bitzero else bitone
function f/* comment */b = if b == bitone then bitzero else bitone
function f b/* comment */= if b == bitone then bitzero else bitone
function f b = /* comment */if b == bitone then bitzero else bitone
// TODO function f b =/* comment */if b == bitone then bitzero else bitone
function f b = if/* comment */b == bitone then bitzero else bitone
function f b = if b/* comment */== bitone then bitzero else bitone
function f b = if b == /* comment */ bitone then bitzero else bitone
// TODO function f b = if b ==/* comment */bitone then bitzero else bitone
function f b = if b == bitone/* comment */then bitzero else bitone
function f b = if b == bitone then/* comment */bitzero else bitone
function f b = if b == bitone then bitzero/* comment */else bitone
function f b = if b == bitone then bitzero else/* comment */bitone
function f b = if b == bitone then bitzero else bitone/* comment */
93 changes: 93 additions & 0 deletions test/format/default/break_indent.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
function f b = if b == bitone then { bitzero } else { bitone }
function f b = if b == bitone then { bitzero } else { bitone }
function f b = if b == bitone then {
let a = 1;
bitzero
} else { bitone }

function f b = if b == bitone then { { bitzero } } else { bitone }
function f b = if b == bitone then { { { bitzero } } } else { bitone }
function f b = if b == bitone then {
{
let a = 1;
bitzero
}
} else { bitone }
function f b = if b == bitone then {
{
{
let a = 1;
bitzero
}
}
} else { bitone }
function f b = if b == bitone then {
{
{
{
let a = 1;
bitzero
}
}
}
} else {
{
{
{
let a = 1;
bitone
}
}
}
}
function f b = if b == bitone then {
{
{
{
let a = 1;
bitzero
}
}
}
} else { { { bitone } } }
function f b = if b == bitone then {
{
{
{
let a = 1;
bitzero
}
}
}
} else {
{
let a = 1;
{ bitone }
}
}

/* comment */
function f /* comment */ b = if b == bitone then { bitzero } else { bitone }
function f /* comment */ b = if b == bitone then { bitzero } else { bitone }
function f b = /* comment */ if b == bitone then { bitzero } else { bitone }
function f b = /* comment */ if b == bitone then { bitzero } else { bitone }

// TODO function f b =/* comment */if b == bitone then bitzero else bitone
function f b = if /* comment */ b == bitone then { bitzero } else { bitone }
function f b = if b == /* comment */ bitone then { bitzero } else { bitone }
function f b = if b == /* comment */ bitone then { bitzero } else { bitone }

// TODO function f b = if b ==/* comment */bitone then bitzero else bitone
function f b = if b == bitone /* comment */ then { bitzero } else { bitone }
function f b = if b == bitone then {
/* comment */ bitzero
} else { bitone }
function f b = if b == bitone then {
bitzero /* comment */
} else { bitone }
function f b = if b == bitone then {
bitzero /* comment */
} else { bitone }
function f b = if b == bitone then {
bitzero /* comment */
} else { bitone }

0 comments on commit 5444750

Please sign in to comment.