public void FindAnyWordSpan3() { Create("foo bar baz"); var span = TssUtil.FindAnyWordSpan(_textBuffer.CurrentSnapshot.GetLineFromLineNumber(0).Extent, WordKind.NormalWord, Path.Backward); Assert.IsTrue(span.IsSome()); Assert.AreEqual("baz", span.Value.GetText()); }
public void FindAnyWordSpan2() { Create("foo bar baz"); var span = TssUtil.FindAnyWordSpan(new SnapshotSpan(_textBuffer.CurrentSnapshot, 0, 2), WordKind.BigWord, Path.Forward); Assert.IsTrue(span.IsSome()); Assert.AreEqual("fo", span.Value.GetText()); }
public void FindAnyWordSpan4() { Create("foo bar baz"); var span = TssUtil.FindAnyWordSpan( new SnapshotSpan(_textBuffer.CurrentSnapshot, 0, _textBuffer.CurrentSnapshot.GetLineFromLineNumber(0).End.Subtract(1).Position), WordKind.NormalWord, Path.Backward); Assert.IsTrue(span.IsSome()); Assert.AreEqual("ba", span.Value.GetText()); }