Пример #1
0
		public void CanCreateInstance() {
			var l = new LexInfo("t", 1, 2, 3, 4);
			Assert.AreEqual("t", l.File);
			Assert.AreEqual(1, l.Line);
			Assert.AreEqual(2, l.Column);
			Assert.AreEqual(3, l.CharIndex);
			Assert.AreEqual(4, l.Length);
		}
Пример #2
0
		public void CanCreateCopy() {
			var l = new LexInfo("t", 1, 2, 3, 4);
			var l2 = l.Clone();
			Assert.AreNotSame(l, l2);
			Assert.AreEqual("t", l2.File);
			Assert.AreEqual(1, l2.Line);
			Assert.AreEqual(2, l2.Column);
			Assert.AreEqual(3, l2.CharIndex);
			Assert.AreEqual(4, l2.Length);
		}
Пример #3
0
		public void GeneratesValidString() {
			var l = new LexInfo("t", 1, 2, 3, 4);
			Assert.AreEqual(" at t : 1:2", l.ToString());
		}
Пример #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 protected bool Equals(LexInfo other)
 {
     return(Column == other.Column && string.Equals(File, other.File) && Line == other.Line);
 }
Пример #5
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="other"></param>
		/// <returns></returns>
		protected bool Equals(LexInfo other){
			return Column == other.Column && string.Equals(File, other.File) && Line == other.Line;
		}