File: saveworld.bsh

package info (click to toggle)
bsh 2.0b4-20
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 4,224 kB
  • sloc: java: 23,431; xml: 4,500; sh: 139; makefile: 24
file content (30 lines) | stat: -rw-r--r-- 601 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/java bsh.Interpreter

source("TestHarness.bsh");

/*
	Test the serializability of everything.
	Save and reconstitute

	Note: in 1.1 the Primitive class .TYPE special classes are not serializable
	It's fixed in 1.2
*/


/*
	This is crashing the Console right now because it tries to serialize
	the desktop (through bsh.desktop).  Why does it crash?  
*/
if ( bsh.desktop == void ) {
	try { 
		save(this, "world.ser"); 
	} catch ( Exception e ) { 
		e.printStackTrace(); 
		assert(false);
	}
	rm("world.ser");
} else
	warning("Test: save world would crash due to desktop... why?");

complete();