public void ShouldNotFindAnyMatchingBracesWhenCursorIsInWhitespaceAtEndOfText() { string bufferText = CreateTokensAndTextBuffer("(declare sym1) "); MatchingBracePair pair = _finder.FindMatchingBraces(bufferText.Length); Assert.IsNull(pair.Start); Assert.IsNull(pair.End); }
public void ShouldNotFindMatchingBracesWhenCursorIsJustLeftOfEndOfList() { string bufferText = CreateTokensAndTextBuffer("(declare sym1) "); MatchingBracePair pair = _finder.FindMatchingBraces(bufferText.IndexOf(")")); Assert.IsNull(pair.Start); Assert.IsNull(pair.End); }
public void ShouldNotFindAnyMatchingBracesWhenCursorIsNotTouchingAny() { CreateTokensAndTextBuffer("(declare sym1)"); MatchingBracePair pair = _finder.FindMatchingBraces(10); Assert.IsNull(pair.Start); Assert.IsNull(pair.End); }
public void ShouldNotFindMatchingBracesWhenTextIsEmpty() { CreateTokensAndTextBuffer(""); MatchingBracePair pair = _finder.FindMatchingBraces(0); Assert.IsNull(pair.Start); Assert.IsNull(pair.End); }
public void ShouldNotFindMatchingBracesWhenCursorIsAfterLastCharacterNonBraceCharacterInText() { string bufferText = CreateTokensAndTextBuffer("(declare sym1"); MatchingBracePair pair = _finder.FindMatchingBraces(bufferText.LastIndexOf("1") + 1); Assert.IsNull(pair.Start); Assert.IsNull(pair.End); }
public void ShouldFindMatchingBracesWhenCursorIsJustAfterLastListEndAndAtEndOfText() { string bufferText = CreateTokensAndTextBuffer("(declare sym1)"); MatchingBracePair pair = _finder.FindMatchingBraces(bufferText.LastIndexOf(")") + 1); Assert.IsNotNull(pair.Start); Assert.IsNotNull(pair.End); }
public void ShouldFindMatchingBraceWhenCursorIsRightBeforeStartOfListNotAtBeginningOfText() { string bufferText = CreateTokensAndTextBuffer(" (declare sym1) "); MatchingBracePair pair = _finder.FindMatchingBraces(bufferText.IndexOf("(")); Assert.IsNotNull(pair.Start); Assert.IsNotNull(pair.End); Assert.AreEqual(bufferText.IndexOf("("), pair.Start.StartIndex); Assert.AreEqual(bufferText.IndexOf(")"), pair.End.StartIndex); }