File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ class LIBSCRATCHCPP_EXPORT List : public Entity
139139 strings.push_back (std::string ());
140140 value_toString (item, &strings.back ());
141141
142- if (value_isValidNumber (item) && !strings.back ().empty ()) {
142+ if (value_isValidNumber (item) && !value_isBool (item) && ! strings.back ().empty ()) {
143143 double doubleNum = value_toDouble (item);
144144 long num = value_toLong (item);
145145
Original file line number Diff line number Diff line change @@ -278,6 +278,20 @@ TEST(ListTest, ToString)
278278 list.toString (s);
279279 ASSERT_EQ (s, " 098" );
280280 ASSERT_EQ (list.toString (), " 098" );
281+
282+ list.clear ();
283+ list.append (" true" );
284+ list.append (" false" );
285+ list.toString (s);
286+ ASSERT_EQ (s, " true false" );
287+ ASSERT_EQ (list.toString (), " true false" );
288+
289+ list.clear ();
290+ list.append (true );
291+ list.append (false );
292+ list.toString (s);
293+ ASSERT_EQ (s, " true false" );
294+ ASSERT_EQ (list.toString (), " true false" );
281295}
282296
283297TEST (ListTest, Clone)
You can’t perform that action at this time.
0 commit comments