mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
LineCommenter.proto.toggleLineCommentsInRange comments / uncomments lines in a selection
This commit is contained in:
@@ -10,9 +10,16 @@ describe "LineCommenter", ->
|
||||
highlighter = new Highlighter(buffer)
|
||||
lineCommenter = new LineCommenter(highlighter)
|
||||
|
||||
fdescribe "toggleLineCommentsInRange", ->
|
||||
lineCommenter.toggleLineCommentsInRange([[4, 5], [7, 8]])
|
||||
expect(buffer.lineForRow(4)).toBe "// while(items.length > 0) {"
|
||||
expect(buffer.lineForRow(5)).toBe "// current = items.shift();"
|
||||
expect(buffer.lineForRow(6)).toBe "// current < pivot ? left.push(current) : right.push(current);"
|
||||
expect(buffer.lineForRow(7)).toBe "// }"
|
||||
describe "toggleLineCommentsInRange", ->
|
||||
it "comments/uncomments lines in the given range", ->
|
||||
lineCommenter.toggleLineCommentsInRange([[4, 5], [7, 8]])
|
||||
expect(buffer.lineForRow(4)).toBe "// while(items.length > 0) {"
|
||||
expect(buffer.lineForRow(5)).toBe "// current = items.shift();"
|
||||
expect(buffer.lineForRow(6)).toBe "// current < pivot ? left.push(current) : right.push(current);"
|
||||
expect(buffer.lineForRow(7)).toBe "// }"
|
||||
|
||||
lineCommenter.toggleLineCommentsInRange([[4, 5], [5, 8]])
|
||||
expect(buffer.lineForRow(4)).toBe " while(items.length > 0) {"
|
||||
expect(buffer.lineForRow(5)).toBe " current = items.shift();"
|
||||
expect(buffer.lineForRow(6)).toBe "// current < pivot ? left.push(current) : right.push(current);"
|
||||
expect(buffer.lineForRow(7)).toBe "// }"
|
||||
|
||||
Reference in New Issue
Block a user