Skip to content

Folding tests #453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 6, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add a few examples
  • Loading branch information
schnittchen committed Nov 25, 2018
commit 12c7d514e506b402b9c6bae460675f053b084f0a
41 changes: 41 additions & 0 deletions spec/folding/basic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,47 @@ def self.it_folds_lines(content, lines, tags = nil)
it_folds_lines(<<~EOF, 2)
defmodule M do
end
"not in fold"
EOF

it_folds_lines(<<~EOF, 4)
defmodule M do
def some_func do
end
end
"not in fold"
EOF

it_folds_lines(<<~EOF, 2, on_line: 2)
defmodule M do
def some_func do
end
end
"not in fold"
EOF

it_folds_lines(<<~EOF, 2)
if true do
end
"not in fold"
EOF

it_folds_lines(<<~EOF, 3, on_line: 3)
if true do
nil
else
nil
end
"not in fold"
EOF

it_folds_lines(<<~EOF, 5, skip: "broken")
if true do
nil
else
nil
end
"not in fold"
EOF
end