using edu.neu.ccs.demeterf.lib;
using System;

/** A quick test of the new "imperative" demfgen.lib.List Methods */
public class SepListTest{
    public static void Main(String[] args){
        if(args.Length != 1){
            p(" usage: SepListTest <length>");
            return;
        }
        
        int len = Int32.Parse(args[0]);
        new SepListTest().main(len);
    }

    static void p(String s, bool t){ p(s+" : "+t); }
    static void p(String s){ Console.WriteLine(s); }
    void main(int len){
        SepList<String,int> lst = SepList<String,int>.create();
        for(int i = len-1; i >= 0; i--){
            lst = lst.push(i, " '"+i+"'");
        }
        
        p("Length", lst.length() == len);
        p("List: "+lst);
        p("List: "+lst.reverse());
        p("Lookup(4): "+lst.lookup(4));
    }
}