Skip to content
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

Fix first token whitespace #86

Merged
merged 3 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def fix(problem)

prev_token = problem[:token].prev_token
next_token = problem[:token].next_token
prev_token.next_token = next_token
prev_token.next_token = next_token unless prev_token.nil?
next_token.prev_token = prev_token unless next_token.nil?
tokens.delete(problem[:token])
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,17 @@
expect(manifest).to eq(fixed)
end
end

context 'empty lines with nothing but whitespace' do
let(:code) { " \n " }

it 'detects problems with both empty lines' do
expect(problems).to have(2).problem
end

it 'fixes the manifest' do
expect(manifest).to eq("\n")
end
end
end
end