X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/8d64e05e37bc3c9a01bd7c5d6e2948470551c351..62189f57e66400fcd1135bfaf6ca2eeb2d233e15:/spec/indent/indent_spec.rb diff --git a/spec/indent/indent_spec.rb b/spec/indent/indent_spec.rb index aa796df..4227b3f 100644 --- a/spec/indent/indent_spec.rb +++ b/spec/indent/indent_spec.rb @@ -502,12 +502,27 @@ shared_examples_for "multiline strings" do end describe "when after a docstring" do - before { vim.feedkeys 'i """' } it "it does indent the next line to the docstring" do - vim.feedkeys '\' + vim.feedkeys 'i """\' indent.should == 4 proposed_indent.should == 4 end + + it "indents the closing docstring quotes" do + vim.feedkeys 'i """\\"""' + indent.should == 4 + proposed_indent.should == 4 + vim.echo('getline(3)').should == ' """' + end + + it "indents non-matching docstring quotes" do + vim.feedkeys 'i """\\' + vim.feedkeys "0C'''" + vim.echo('line(".")').should == "4" + vim.echo('getline(".")').should == "'''" + indent.should == 0 + proposed_indent.should == -1 + end end describe "when after a docstring with contents" do @@ -704,3 +719,11 @@ describe "Using O" do indent.should == 0 end end + +describe "searchpairpos" do + before { vim.feedkeys '\ggdG' } + it "handles nested parenthesis" do + vim.feedkeys 'iif foo.startswith("("):\' + indent.should == shiftwidth + end +end