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
139
139
strings.push_back (std::string ());
140
140
value_toString (item, &strings.back ());
141
141
142
- if (value_isValidNumber (item) && !strings.back ().empty ()) {
142
+ if (value_isValidNumber (item) && !value_isBool (item) && ! strings.back ().empty ()) {
143
143
double doubleNum = value_toDouble (item);
144
144
long num = value_toLong (item);
145
145
Original file line number Diff line number Diff line change @@ -278,6 +278,20 @@ TEST(ListTest, ToString)
278
278
list.toString (s);
279
279
ASSERT_EQ (s, " 098" );
280
280
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" );
281
295
}
282
296
283
297
TEST (ListTest, Clone)
You can’t perform that action at this time.
0 commit comments