WordPress.org

Make WordPress Core

Ticket #19067: test_19067.patch

File test_19067.patch, 748 bytes (added by soulseekah, 3 years ago)
  • tests/media.php

     
    158158                $this->assertEquals( '1kB', wp_convert_bytes_to_hr( $kb ) ); 
    159159 
    160160                // now some values around 
    161                 $this->assertEquals( '1.5009765625GB', wp_convert_bytes_to_hr( $gb + $gb / 2 + $mb ) ); 
    162                 $this->assertEquals( '1022.99902344MB', wp_convert_bytes_to_hr( $gb - $mb - $kb ) ); 
     161                $this->assertTrue( abs( 1.5009765625 - (float)wp_convert_bytes_to_hr( $gb + $gb / 2 + $mb ) ) < 0.0001 ); 
     162                $this->assertTrue( abs( 1022.99902344 - (float)wp_convert_bytes_to_hr( $gb - $mb - $kb ) ) < 0.0001 ); 
    163163 
    164164                // edge 
    165165                $this->assertEquals( 'NANB', wp_convert_bytes_to_hr( -1 ) );