@Test
public void testVersionCanonicalization()
{
Version version;
version = new Version( "1.2.3.0" );
assertEquals( 3, version.length() );
assertEquals( 1l, version.segment( 0 ) );
assertEquals( 2l, version.segment( 1 ) );
assertEquals( 3l, version.segment( 2 ) );
assertEquals( 0l, version.segment( 3 ) );
assertEquals( 0l, version.segment( 1000 ) );
assertEquals( list( 1l, 2l, 3l ), version.segments() );
version = new Version( "1.2.3.0.0.0.0" );
assertEquals( 3, version.length() );
assertEquals( 1l, version.segment( 0 ) );
assertEquals( 2l, version.segment( 1 ) );
assertEquals( 3l, version.segment( 2 ) );
assertEquals( 0l, version.segment( 3 ) );
assertEquals( 0l, version.segment( 4 ) );
assertEquals( 0l, version.segment( 5 ) );
assertEquals( 0l, version.segment( 6 ) );
assertEquals( 0l, version.segment( 1000 ) );
assertEquals( list( 1l, 2l, 3l ), version.segments() );
}