#!/bin/java bsh.Interpreter

source("TestHarness.bsh");

// Joakim Sandgren <joakim.sandgren@free.fr>
Vector proc(Vector midic) {     
        Vector resultat = new Vector();
		print("here2");
        for(int i = 0; i < midic.size(); i++) 
		{
            for (int j = i; j < midic.size() - i; j++) {
				resultat.addElement( ""+j );
            } 
        }
        return resultat;
}

v = new Vector();
v.addElement("foo");
v.addElement("foo");
v.addElement("foo");
v2 = proc( v );

// had to add something to assert... 
assert( v2.elementAt(3).equals("1") );

/**
	Nested for loops caused a bug in one rev
*/
i=99;
x=2;
for(i=1, a=5; i<3; i++) {
	for(j=0; j<2; j++) {
		assert(x==2);
		assert(a==5);
		assert(i>=1 && i<=3);
	}
}

complete();
