MCPcopy
hub / github.com/libgdx/libgdx / paddingTest

Method paddingTest

gdx/test/com/badlogic/gdx/utils/CharArrayTest.java:416–439  ·  view source on GitHub ↗

Test padding and fixed width methods

()

Source from the content-addressed store, hash-verified

414
415 /** Test padding and fixed width methods */
416 @Test
417 public void paddingTest () {
418 CharArray array = new CharArray();
419
420 // Append padding
421 array.append("Hello");
422 array.appendPadding(5, '*');
423 Assert.assertEquals("Hello*****", array.toString());
424 array.clear();
425
426 // Fixed width pad left
427 array.appendFixedWidthPadLeft("42", 5, '0');
428 Assert.assertEquals("00042", array.toString());
429 array.clear();
430
431 array.appendFixedWidthPadLeft("12345", 3, '0');
432 Assert.assertEquals("345", array.toString()); // Keeps rightmost chars when too long
433 array.clear();
434
435 // Fixed width pad right
436 array.appendFixedWidthPadRight("Hi", 5, ' ');
437 Assert.assertEquals("Hi ", array.toString());
438 array.clear();
439 }
440
441 /** Test delete methods */
442 @Test

Callers

nothing calls this directly

Calls 7

appendMethod · 0.95
appendPaddingMethod · 0.95
toStringMethod · 0.95
clearMethod · 0.95
assertEqualsMethod · 0.45

Tested by

no test coverage detected