#!/bin/java bsh.Interpreter

source("TestHarness.bsh");

// junk
assert( (int)22 == (short)22 );
int i=22;
short s = 22;
assert( i == s );

// verify that the switch expression is promoted / boxed properly

int ifield = 22;
switch( ifield )
{
case 22:
	flag();
default:
} 

long lfield =22;
switch( lfield )
{
case 22:
	flag();
default:
} 

iw = new Integer(22);
switch( iw )
{
case 22:
	flag();
default:
} 

float f = 22.0f;
switch( f )
{
case 22:
	flag();
default:
} 

bw = new Byte((byte)22);
switch( bw )
{
case 22:
	flag();
default:
} 

short sfield = 22;
switch( sfield )
{
case 22:
	flag();
default:
} 

switch( Fields.shortTwentyTwo )
{
case 22:
	flag();
default:
} 

byte bfield = 22;
switch( bfield )
{
case 22:
	flag();
default:
} 

// object switch

fooobj=object();
barobj=object();
switch( fooobj ) 
{
case barobj:
	print("barobj");
	assert(false);

case fooobj:
	flag();
	print("fooobj");

default:
}

dateobj = new Date(42);
dateobj2 = new Date(42);
switch( dateobj ) 
{
case dateobj2:
	flag();
	print("date1");

case dateobj:
	flag();
	print("date2");

default:
}

assert( flag() == 11 );

complete();
