#!/usr/bin/env kjscmd

println( '==============================' );

println( 'Text with newline' );
System.stdout.println( 'Text with newline' );

System.stdout.print( 'There should be an OK after the colon: ' );
System.stdout.println( 'OK' );

System.stdout.println( 'stdin is readable: ' + System.stdin.isReadable() );
System.stdout.println( 'stdin is writable: ' + System.stdin.isWritable() );

System.stdout.println( 'stdout is readable: ' + System.stdout.isReadable() );
System.stdout.println( 'stdout is writable: ' + System.stdout.isWritable() );

System.stdout.println( 'stderr is readable: ' + System.stderr.isReadable() );
System.stdout.println( 'stderr is writable: ' + System.stderr.isWritable() );

System.stdout.println( 'There should be an exception now: ' );
System.stdin.println( 'INVALID' );

System.stdout.println( 'There should be another exception: ' );
System.stdout.readLine( 'INVALID' );

println( '==============================' );
System.stdout.println( dump(System.stdin) );

System.exit(0);
