}
}
public void testWidth() throws RecognitionException, IOException {
VM vm = new VM("ENTRY { " + " address " + " author " + " title " + " type "
+ "} {} { label } " + //
"STRINGS { longest.label } " + //
"INTEGERS { number.label longest.label.width } " + //
"FUNCTION {initialize.longest.label} " + //
"{ \"\" 'longest.label := " + //
" #1 'number.label := " + //
" #0 'longest.label.width := " + //
"} " + //
" " + //
" FUNCTION {longest.label.pass} " + //
" { number.label int.to.str$ 'label := " + //
" number.label #1 + 'number.label := " + //
" label width$ longest.label.width > " + //
" { label 'longest.label := " + //
" label width$ 'longest.label.width := " + //
" } " + //
" 'skip$ " + //
" if$ " + //
" } " + //
" " + //
" EXECUTE {initialize.longest.label} " + //
" " + //
" ITERATE {longest.label.pass} " + //
"FUNCTION {begin.bib} " + //
"{ preamble$ empty$" + //
" 'skip$" + //
" { preamble$ write$ newline$ }" + //
" if$" + //
" \"\\begin{thebibliography}{\" longest.label * \"}\" *" + //
"}" + //
"EXECUTE {begin.bib}" + //
"");//
Vector<BibtexEntry> v = new Vector<BibtexEntry>();
v.add(t1BibtexEntry());
vm.run(v);
assertTrue(vm.getIntegers().containsKey("longest.label.width"));
assertEquals("\\begin{thebibliography}{1}", vm.getStack().pop());
}