Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for TestCompare (0.52 sec)

  1. src/bytes/compare_test.go

    	{[]byte("abcdefghj"), []byte("abcdefghi"), 1},
    	// nil tests
    	{nil, nil, 0},
    	{[]byte(""), nil, 0},
    	{nil, []byte(""), 0},
    	{[]byte("a"), nil, 1},
    	{nil, []byte("a"), -1},
    }
    
    func TestCompare(t *testing.T) {
    	for _, tt := range compareTests {
    		numShifts := 16
    		buffer := make([]byte, len(tt.b)+numShifts)
    		// vary the input alignment of tt.b
    		for offset := 0; offset <= numShifts; offset++ {
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Thu Jul 13 23:11:42 UTC 2023
    - 6.8K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/primitives/SignedBytesTest.java

          assertWithMessage(value + " not found in exception text: " + ex.getMessage())
              .that(ex.getMessage().contains(String.valueOf(value)))
              .isTrue();
        }
      }
    
      public void testCompare() {
        for (byte x : VALUES) {
          for (byte y : VALUES) {
            // Only compare the sign of the result of compare().
            int expected = Byte.compare(x, y);
            int actual = SignedBytes.compare(x, y);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 7K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/primitives/UnsignedIntegerTest.java

        for (int a : TEST_INTS) {
          assertThrows(
              ArithmeticException.class,
              () -> UnsignedInteger.fromIntBits(a).mod(UnsignedInteger.ZERO));
        }
      }
    
      public void testCompare() {
        for (int a : TEST_INTS) {
          for (int b : TEST_INTS) {
            UnsignedInteger aUnsigned = UnsignedInteger.fromIntBits(a);
            UnsignedInteger bUnsigned = UnsignedInteger.fromIntBits(b);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 9.6K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/primitives/UnsignedLongsTest.java

     */
    @GwtCompatible
    @NullUnmarked
    public class UnsignedLongsTest extends TestCase {
      private static final long LEAST = 0L;
      private static final long GREATEST = 0xffffffffffffffffL;
    
      public void testCompare() {
        // max value
        assertThat(UnsignedLongs.compare(0, 0xffffffffffffffffL)).isLessThan(0);
        assertThat(UnsignedLongs.compare(0xffffffffffffffffL, 0)).isGreaterThan(0);
    
        // both with high bit set
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 12.8K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/primitives/SignedBytesTest.java

          assertWithMessage(value + " not found in exception text: " + ex.getMessage())
              .that(ex.getMessage().contains(String.valueOf(value)))
              .isTrue();
        }
      }
    
      public void testCompare() {
        for (byte x : VALUES) {
          for (byte y : VALUES) {
            // Only compare the sign of the result of compare().
            int expected = Byte.compare(x, y);
            int actual = SignedBytes.compare(x, y);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 7K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/primitives/CharsTest.java

              .that(ex.getMessage().contains(String.valueOf(value)))
              .isTrue();
        }
      }
    
      // We need to test that our method behaves like the JDK method.
      @SuppressWarnings("InlineMeInliner")
      public void testCompare() {
        for (char x : VALUES) {
          for (char y : VALUES) {
            assertWithMessage(x + ", " + y)
                .that(Math.signum(Chars.compare(x, y)))
                .isEqualTo(Math.signum(Character.compare(x, y)));
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 25.9K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/primitives/DoublesTest.java

          assertThat(Doubles.isFinite(value)).isEqualTo(Double.isFinite(value));
        }
      }
    
      // We need to test that our method behaves like the JDK method.
      @SuppressWarnings("InlineMeInliner")
      public void testCompare() {
        for (double x : VALUES) {
          for (double y : VALUES) {
            // note: spec requires only that the sign is the same
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 30.9K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/primitives/IntsTest.java

              .isTrue();
        }
      }
    
      // We need to test that our method behaves like the JDK method.
      @SuppressWarnings("InlineMeInliner")
      public void testCompare() {
        for (int x : VALUES) {
          for (int y : VALUES) {
            // note: spec requires only that the sign is the same
            assertWithMessage(x + ", " + y).that(Ints.compare(x, y)).isEqualTo(Integer.compare(x, y));
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 29.2K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/primitives/BooleansTest.java

        assertThat(Booleans.falseFirst().compare(true, false)).isGreaterThan(0);
      }
    
      // We need to test that our method behaves like the JDK method.
      @SuppressWarnings("InlineMeInliner")
      public void testCompare() {
        for (boolean x : VALUES) {
          for (boolean y : VALUES) {
            // note: spec requires only that the sign is the same
            assertWithMessage(x + ", " + y)
                .that(Booleans.compare(x, y))
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 25K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/primitives/DoublesTest.java

          assertThat(Doubles.isFinite(value)).isEqualTo(Double.isFinite(value));
        }
      }
    
      // We need to test that our method behaves like the JDK method.
      @SuppressWarnings("InlineMeInliner")
      public void testCompare() {
        for (double x : VALUES) {
          for (double y : VALUES) {
            // note: spec requires only that the sign is the same
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 30.9K bytes
    - Viewed (0)
Back to top