// StringTest.m -- test out the String class

#import "String.m"
#import <appkit/appkit.h>
#import <stdio.h>

void main()
{
	id string1, string2, string3, string4, string5, string6;
	string1 = [[[String alloc] init] setString:"The first string."];
	string2 = [[[String alloc] init] setString:"01234567890123456789"];
	printf("string1 = \"%s\", length = %d.\n", [string1 stringValue], [string1 length]);
	printf("string2 = \"%s\", length = %d.\n", [string2 stringValue], [string2 length]);
	string3 = [string1 copy];
	[string3 concatenate:string2];
	printf("String1 + String2 = \"%s\", length = %d.\n", [string3 stringValue], [string3 length]);
	printf("String1 = \"%s\", length = %d.\n", [string1 stringValue], [string1 length]);
	[string3 free];
	printf("string1!=string1: %d, string1!=string2: %d\n", [string1 compareTo:string1], [string1 compareTo:string2]);
	string3 = [string2 left:5];
	string4 = [string2 right:5];
	string5 = [string2 midFrom:5 to:10];
	string6 = [string2 midFrom:6 length:5];
	printf("left5 = %s right5 = %s mid5to10 = %s mid6len5 = %s\n", [string3 stringValue], [string4 stringValue], [string5 stringValue], [string6 stringValue]);
	exit(0);
}
