public void FindPreviousWordSpan6() { Create("foo bar"); var line = _snapshot.GetLineFromLineNumber(0); var span = TssUtil.FindPreviousWordSpan(line.End, WordKind.NormalWord); Assert.AreEqual("bar", span.GetText()); }
public void FindPreviousWordSpan7() { Create(" foo bar"); var line = _snapshot.GetLineFromLineNumber(0); var span = TssUtil.FindPreviousWordSpan(line.Start.Add(2), WordKind.NormalWord); Assert.AreEqual(0, span.Length); Assert.AreEqual(line.Start, span.Start); }
public void FindPreviousWordSpan4() { Create("foo bar"); var line = _snapshot.GetLineFromLineNumber(0); var point = line.Start + 4; Assert.AreEqual('b', point.GetChar()); var span = TssUtil.FindPreviousWordSpan(point, WordKind.NormalWord); Assert.AreEqual("foo", span.GetText()); }