Gleam indentation tests

This commit is contained in:
Connor Lay (Clay) 2022-02-12 15:12:05 -08:00 committed by Stephan Seitz
parent 4a5720332d
commit b62750e328
16 changed files with 239 additions and 0 deletions

View file

@ -0,0 +1,4 @@
pub fn main() {
assert Ok(i) =
parse_int("123")
}

View file

@ -0,0 +1,4 @@
pub fn main() {
True &&
False
}

View file

@ -0,0 +1,10 @@
pub fn main() {
case 1 {
1 -> "One"
2 -> {
case 2 {
2 -> "Two"
}
}
}
}

View file

@ -0,0 +1,2 @@
pub const foo =
"bar"

View file

@ -0,0 +1,15 @@
import gleam/io
pub fn main() {
io.println("Hello from main!")
}
fn hidden() {
io.println("Hello from hidden!")
}
pub external fn inspect(a) -> a =
"Elixir.IO" "inspect"
external fn inspect(a) -> a =
"Elixir.IO" "inspect"

View file

@ -0,0 +1,4 @@
import foo.{
Bar,
baz,
}

View file

@ -0,0 +1,4 @@
pub fn main() {
let string =
"string"
}

View file

@ -0,0 +1,11 @@
pub fn main() {
[
a,
..[
b,
..[
c,
]
]
]
}

View file

@ -0,0 +1,4 @@
pub fn main() {
one()
|> two()
}

View file

@ -0,0 +1,5 @@
pub fn main() {
todo(
"Foo"
)
}

View file

@ -0,0 +1,7 @@
pub fn main() {
try int_a =
parse_int(a)
try int_b =
parse_int(b)
Ok(int_a + int_b)
}

View file

@ -0,0 +1,11 @@
pub fn main() {
#(
a,
#(
b,
#(
c
)
)
)
}

View file

@ -0,0 +1,18 @@
pub type Cat {
Cat(name: String, cuteness: Int)
}
type User {
LoggedIn(name: String)
Guest
}
pub opaque type Counter {
Counter(value: Int)
}
pub type Headers =
List(#(String, String))
type Headers =
List(#(String, String))