ObjFW  Diff

Differences From Artifact [fe0644a99a]:

To Artifact [14295c4581]:


281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
	    [[a objectAtIndex: i++] isEqual: @"foo"] &&
	    [[a objectAtIndex: i++] isEqual: @"bar"] &&
	    [[a objectAtIndex: i++] isEqual: @"baz"])

	TEST(@"+[pathWithComponents:]",
	    (is = [OFString pathWithComponents: [OFArray arrayWithObjects:
	    @"foo", @"bar", @"baz", nil]]) &&
#ifndef _WIN32
	    [is isEqual: @"foo/bar/baz"] &&
#else
	    [is isEqual: @"foo\\bar\\baz"] &&
#endif
	    (is = [OFString pathWithComponents:
	    [OFArray arrayWithObjects: @"foo", nil]]) &&
	    [is isEqual: @"foo"])







|







281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
	    [[a objectAtIndex: i++] isEqual: @"foo"] &&
	    [[a objectAtIndex: i++] isEqual: @"bar"] &&
	    [[a objectAtIndex: i++] isEqual: @"baz"])

	TEST(@"+[pathWithComponents:]",
	    (is = [OFString pathWithComponents: [OFArray arrayWithObjects:
	    @"foo", @"bar", @"baz", nil]]) &&
#if !defined(_WIN32) && !defined(__DJGPP__)
	    [is isEqual: @"foo/bar/baz"] &&
#else
	    [is isEqual: @"foo\\bar\\baz"] &&
#endif
	    (is = [OFString pathWithComponents:
	    [OFArray arrayWithObjects: @"foo", nil]]) &&
	    [is isEqual: @"foo"])
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
	    [[@"foo" stringByDeletingLastPathComponent] isEqual: @"."])

	TEST(@"-[stringByDeletingPathExtension]",
	    [[@"foo.bar" stringByDeletingPathExtension] isEqual: @"foo"] &&
	    [[@"foo..bar" stringByDeletingPathExtension] isEqual: @"foo."] &&
	    [[@"/foo./bar" stringByDeletingPathExtension]
	    isEqual: @"/foo./bar"] &&
#ifndef _WIN32
	    [[@"/foo./bar.baz" stringByDeletingPathExtension]
	    isEqual: @"/foo./bar"] &&
#else
	    [[@"/foo./bar.baz" stringByDeletingPathExtension]
	    isEqual: @"\\foo.\\bar"] &&
#endif
	    [[@"foo.bar/" stringByDeletingPathExtension] isEqual: @"foo"] &&







|







345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
	    [[@"foo" stringByDeletingLastPathComponent] isEqual: @"."])

	TEST(@"-[stringByDeletingPathExtension]",
	    [[@"foo.bar" stringByDeletingPathExtension] isEqual: @"foo"] &&
	    [[@"foo..bar" stringByDeletingPathExtension] isEqual: @"foo."] &&
	    [[@"/foo./bar" stringByDeletingPathExtension]
	    isEqual: @"/foo./bar"] &&
#if !defined(_WIN32) && !defined(__DJGPP__)
	    [[@"/foo./bar.baz" stringByDeletingPathExtension]
	    isEqual: @"/foo./bar"] &&
#else
	    [[@"/foo./bar.baz" stringByDeletingPathExtension]
	    isEqual: @"\\foo.\\bar"] &&
#endif
	    [[@"foo.bar/" stringByDeletingPathExtension] isEqual: @"foo"] &&
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
	 */
	TEST(@"-[floatValue]",
	    [@"\t-0.25 " floatValue] == -0.25 &&
	    [@"\r-INFINITY\n" floatValue] == -INFINITY &&
	    isnan([@"   NAN\t\t" floatValue]))

	TEST(@"-[doubleValue]",
#ifndef __ANDROID__
	    [@"\t-0x1.FFFFFFFFFFFFFP-1020 " doubleValue] ==
	    -0x1.FFFFFFFFFFFFFP-1020 &&
#else
	    /* strtod() does not accept 0x on Android */
	    [@"\t-0.123456789 " doubleValue] == -0.123456789 &&
#endif
	    [@"\r-INFINITY\n" doubleValue] == -INFINITY &&
	    isnan([@"   NAN\t\t" doubleValue]))

	EXPECT_EXCEPTION(@"Detect invalid characters in -[decimalValue] #1",
	    OFInvalidFormatException, [@"abc" decimalValue])







|



|







380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
	 */
	TEST(@"-[floatValue]",
	    [@"\t-0.25 " floatValue] == -0.25 &&
	    [@"\r-INFINITY\n" floatValue] == -INFINITY &&
	    isnan([@"   NAN\t\t" floatValue]))

	TEST(@"-[doubleValue]",
#if !defined(__ANDROID__) && !defined(__DJGPP__)
	    [@"\t-0x1.FFFFFFFFFFFFFP-1020 " doubleValue] ==
	    -0x1.FFFFFFFFFFFFFP-1020 &&
#else
	    /* Android and DJGPPP do not accept 0x for strtod() */
	    [@"\t-0.123456789 " doubleValue] == -0.123456789 &&
#endif
	    [@"\r-INFINITY\n" doubleValue] == -INFINITY &&
	    isnan([@"   NAN\t\t" doubleValue]))

	EXPECT_EXCEPTION(@"Detect invalid characters in -[decimalValue] #1",
	    OFInvalidFormatException, [@"abc" decimalValue])