@@ -351,7 +351,8 @@ private Q_SLOTS:
351351 // Quotes are removed when using the anim getter.
352352 QCOMPARE (p.anim_get (" foo" , 0 ), " 50=100; 60=60; 100=0" );
353353 // Anim strings may contain delimiters and equal signs if quoted.
354- p.set (" foo" , " 50=100; 60=\" 60; 100=0\" ;\" hello=world\" " );
354+ p.set (" foo" , " 50=100; 60=\" 60; 100=0\" ;0=\" hello=world\" " );
355+ QVERIFY (p.is_anim (" foo" ));
355356 QCOMPARE (p.anim_get (" foo" , 0 ), " hello=world" );
356357 QCOMPARE (p.anim_get (" foo" , 50 ), " 100" );
357358 QCOMPARE (p.anim_get (" foo" , 60 ), " 60; 100=0" );
@@ -363,14 +364,30 @@ private Q_SLOTS:
363364 // A URL containing '=' in query parameters must not be treated as animation.
364365 const char *url = " https://example.com/video?token=abc123&quality=high" ;
365366 p.set (" foo" , url);
366- QVERIFY (!p.get_animation (" foo" ));
367+ QVERIFY (!p.is_anim (" foo" ));
367368 QCOMPARE (p.get (" foo" ), url);
368369 QCOMPARE (p.anim_get (" foo" , 0 ), url);
369370 // Verify the property is not animated.
370371 p.anim_get (" foo" , 0 );
371372 QVERIFY (!p.get_animation (" foo" ));
372373 }
373374
375+ void ParseUntilJunk ()
376+ {
377+ Properties p;
378+ // "foo=bar" is junk and parsing will stop after it
379+ const char *str = " 50=100;foo=bar;60=120" ;
380+ p.set (" foo" , str);
381+ QVERIFY (p.is_anim (" foo" ));
382+ QCOMPARE (p.get (" foo" ), str);
383+ QCOMPARE (p.anim_get (" foo" , 50 ), " 100" );
384+ QCOMPARE (p.anim_get (" foo" , 60 ), " 100" ); // NOT 120
385+ // Verify the property is animated and only has one key.
386+ Animation a = p.get_animation (" foo" );
387+ QVERIFY (a.is_valid ());
388+ QCOMPARE (a.key_count (), 1 );
389+ }
390+
374391 void ShiftFramesPositive ()
375392 {
376393 Properties p;
0 commit comments