package compiler;
import static org.junit.Assert.*;

import org.junit.Test;

import compiler.IdVar;
import compiler.Type;


public class IdVarTest {

	
	@Test
	public void testOffset() {
		IdVar i1= new IdVar('a', Type.INTEGER);
		IdVar i2= new IdVar('a', Type.INTEGER);
		
		assertEquals(i1.getOffset(),-2);		
		assertEquals(i2.getOffset(),-4);
		
		i1.setVal('3');
		assertEquals(i1.getOffset(),-2);		
		
		
	}

}

@@ -194,37 +194,32 @@
 r i1= new IdVar(
-'a', 
 Type.INTEGER);%0A%09
@@ -243,13 +243,8 @@
 Var(
-'a', 
 Type
@@ -257,16 +257,96 @@
 ER);%0A%09%09%0A
+%09%09TabIdent t = new TabIdent();%0A%09%09t.addIdent(%22a%22, i1);%0A%09%09t.addIdent(%22a%22, i2);%0A%09%09%0A
 %09%09assert
@@ -418,21 +418,25 @@
 %09%0A%09%09
-i1.setVal('3'
+t.addIdent(%223%22,i1
 );%0A%09

update toward idvar change