@@ -781,6 +781,38 @@ TEST(TargetTest, BubbleText)
781781 target.setBubbleText (longstr);
782782 ASSERT_EQ (target.bubbleText ().length (), 330 );
783783 ASSERT_EQ (target.bubbleText (), longstr.substr (0 , 330 ));
784+
785+ // Integers should be left unchanged
786+ target.setBubbleText (" 8" );
787+ ASSERT_EQ (target.bubbleText (), " 8" );
788+
789+ target.setBubbleText (" -52" );
790+ ASSERT_EQ (target.bubbleText (), " -52" );
791+
792+ target.setBubbleText (" 0" );
793+ ASSERT_EQ (target.bubbleText (), " 0" );
794+
795+ // Non-integers should be rounded to 2 decimal places (no more, no less), unless they're small enough that rounding would display them as 0.00 (#478)
796+ target.setBubbleText (" 8.324" );
797+ ASSERT_EQ (target.bubbleText (), " 8.32" );
798+
799+ target.setBubbleText (" -52.576" );
800+ ASSERT_EQ (target.bubbleText (), " -52.58" );
801+
802+ target.setBubbleText (" 3.5" );
803+ ASSERT_EQ (target.bubbleText (), " 3.5" );
804+
805+ target.setBubbleText (" 0.015" );
806+ ASSERT_EQ (target.bubbleText (), " 0.02" );
807+
808+ target.setBubbleText (" -0.015" );
809+ ASSERT_EQ (target.bubbleText (), " -0.02" );
810+
811+ target.setBubbleText (" 0.005" );
812+ ASSERT_EQ (target.bubbleText (), " 0.005" );
813+
814+ target.setBubbleText (" -0.005" );
815+ ASSERT_EQ (target.bubbleText (), " -0.005" );
784816}
785817
786818TEST (TargetTest, Engine)
0 commit comments