@@ -549,10 +549,11 @@ [[C(@"foo") stringByAppendingString: @"bar"] isEqual: @"foobar"]) TEST(@"-[stringByPrependingString:]", [[C(@"foo") stringByPrependingString: @"bar"] isEqual: @"barfoo"]) +#ifdef OF_HAVE_FILES s[0] = [mutableStringClass stringWithString: @"foo"]; [s[0] appendString: OF_PATH_DELIMITER_STRING]; [s[0] appendString: @"bar"]; s[1] = [mutableStringClass stringWithString: s[0]]; [s[1] appendString: OF_PATH_DELIMITER_STRING]; @@ -559,10 +560,11 @@ is = [stringClass stringWithString: s[1]]; [s[1] appendString: @"baz"]; TEST(@"-[stringByAppendingPathComponent:]", [[s[0] stringByAppendingPathComponent: @"baz"] isEqual: s[1]] && [[is stringByAppendingPathComponent: @"baz"] isEqual: s[1]]) +#endif s[0] = [mutableStringClass stringWithString: @"foo"]; [s[0] appendString: @"/"]; [s[0] appendString: @"bar"]; s[1] = [mutableStringClass stringWithString: s[0]]; @@ -598,23 +600,24 @@ [a count] == 3 && [[a objectAtIndex: i++] isEqual: @"foo"] && [[a objectAtIndex: i++] isEqual: @"bar"] && [[a objectAtIndex: i++] isEqual: @"baz"]) -#if !defined(OF_WINDOWS) && !defined(OF_MSDOS) -# define EXPECTED @"foo/bar/baz" -#else -# define EXPECTED @"foo\\bar\\baz" -#endif +#ifdef OF_HAVE_FILES +# if !defined(OF_WINDOWS) && !defined(OF_MSDOS) +# define EXPECTED @"foo/bar/baz" +# else +# define EXPECTED @"foo\\bar\\baz" +# endif TEST(@"+[pathWithComponents:]", (is = [stringClass pathWithComponents: [OFArray arrayWithObjects: @"foo", @"bar", @"baz", nil]]) && [is isEqual: EXPECTED] && (is = [stringClass pathWithComponents: [OFArray arrayWithObjects: @"foo", nil]]) && [is isEqual: @"foo"]) -#undef EXPECTED +# undef EXPECTED TEST(@"-[pathComponents]", /* /tmp */ (a = [C(@"/tmp") pathComponents]) && [a count] == 2 && [[a objectAtIndex: 0] isEqual: @""] && @@ -663,15 +666,15 @@ [[C(@"foo/bar") stringByDeletingLastPathComponent] isEqual: @"foo"] && [[C(@"/") stringByDeletingLastPathComponent] isEqual: @"/"] && [[C(@"foo") stringByDeletingLastPathComponent] isEqual: @"."]) -#if !defined(OF_WINDOWS) && !defined(OF_MSDOS) -# define EXPECTED @"/foo./bar" -#else -# define EXPECTED @"\\foo.\\bar" -#endif +# if !defined(OF_WINDOWS) && !defined(OF_MSDOS) +# define EXPECTED @"/foo./bar" +# else +# define EXPECTED @"\\foo.\\bar" +# endif TEST(@"-[stringByDeletingPathExtension]", [[C(@"foo.bar") stringByDeletingPathExtension] isEqual: @"foo"] && [[C(@"foo..bar") stringByDeletingPathExtension] isEqual: @"foo."] && [[C(@"/foo./bar") stringByDeletingPathExtension] isEqual: @"/foo./bar"] && @@ -678,11 +681,12 @@ [[C(@"/foo./bar.baz") stringByDeletingPathExtension] isEqual: EXPECTED] && [[C(@"foo.bar/") stringByDeletingPathExtension] isEqual: @"foo"] && [[C(@".foo") stringByDeletingPathExtension] isEqual: @".foo"] && [[C(@".foo.bar") stringByDeletingPathExtension] isEqual: @".foo"]) -#undef EXPECTED +# undef EXPECTED +#endif TEST(@"-[decimalValue]", [C(@"1234") decimalValue] == 1234 && [C(@"\r\n+123 ") decimalValue] == 123 && [C(@"-500\t") decimalValue] == -500 &&