@@ -1384,4 +1384,100 @@ mod tests {
13841384 }
13851385 "# } ) ;
13861386 }
1387+
1388+ #[ test]
1389+ fn test_animation ( ) {
1390+ minify_test ( ".foo { animation-name: test }" , ".foo{animation-name:test}" ) ;
1391+ minify_test ( ".foo { animation-name: \" test\" }" , ".foo{animation-name:test}" ) ;
1392+ minify_test ( ".foo { animation-name: foo, bar }" , ".foo{animation-name:foo,bar}" ) ;
1393+ minify_test ( ".foo { animation-duration: 100ms }" , ".foo{animation-duration:.1s}" ) ;
1394+ minify_test ( ".foo { animation-duration: 100ms, 2000ms }" , ".foo{animation-duration:.1s,2s}" ) ;
1395+ minify_test ( ".foo { animation-timing-function: ease }" , ".foo{animation-timing-function:ease}" ) ;
1396+ minify_test ( ".foo { animation-timing-function: cubic-bezier(0.42, 0, 1, 1) }" , ".foo{animation-timing-function:ease-in}" ) ;
1397+ minify_test ( ".foo { animation-timing-function: ease, cubic-bezier(0.42, 0, 1, 1) }" , ".foo{animation-timing-function:ease,ease-in}" ) ;
1398+ minify_test ( ".foo { animation-iteration-count: 5 }" , ".foo{animation-iteration-count:5}" ) ;
1399+ minify_test ( ".foo { animation-iteration-count: 2.5 }" , ".foo{animation-iteration-count:2.5}" ) ;
1400+ minify_test ( ".foo { animation-iteration-count: 2.0 }" , ".foo{animation-iteration-count:2}" ) ;
1401+ minify_test ( ".foo { animation-iteration-count: infinite }" , ".foo{animation-iteration-count:infinite}" ) ;
1402+ minify_test ( ".foo { animation-iteration-count: 1, infinite }" , ".foo{animation-iteration-count:1,infinite}" ) ;
1403+ minify_test ( ".foo { animation-direction: reverse }" , ".foo{animation-direction:reverse}" ) ;
1404+ minify_test ( ".foo { animation-direction: alternate, reverse }" , ".foo{animation-direction:alternate,reverse}" ) ;
1405+ minify_test ( ".foo { animation-play-state: paused }" , ".foo{animation-play-state:paused}" ) ;
1406+ minify_test ( ".foo { animation-play-state: running, paused }" , ".foo{animation-play-state:running,paused}" ) ;
1407+ minify_test ( ".foo { animation-delay: 100ms }" , ".foo{animation-delay:.1s}" ) ;
1408+ minify_test ( ".foo { animation-delay: 100ms, 2000ms }" , ".foo{animation-delay:.1s,2s}" ) ;
1409+ minify_test ( ".foo { animation-fill-mode: forwards }" , ".foo{animation-fill-mode:forwards}" ) ;
1410+ minify_test ( ".foo { animation-fill-mode: Backwards,forwards }" , ".foo{animation-fill-mode:backwards,forwards}" ) ;
1411+ minify_test ( ".foo { animation: 3s ease-in 1s infinite reverse both running slidein }" , ".foo{animation:slidein 3s ease-in 1s infinite reverse both}" ) ;
1412+ minify_test ( ".foo { animation: 3s slidein paused ease 1s 1 reverse both }" , ".foo{animation:slidein 3s 1s reverse both paused}" ) ;
1413+ minify_test ( ".foo { animation: 3s ease ease }" , ".foo{animation:ease 3s ease}" ) ;
1414+ minify_test ( ".foo { animation: 3s cubic-bezier(0.25, 0.1, 0.25, 1) foo }" , ".foo{animation:foo 3s}" ) ;
1415+ minify_test ( ".foo { animation: foo 0s 3s infinite }" , ".foo{animation:foo 0s 3s infinite}" ) ;
1416+ minify_test ( ".foo { animation: none }" , ".foo{animation:none}" ) ;
1417+ test ( r#"
1418+ .foo {
1419+ animation-name: foo;
1420+ animation-duration: 0.09s;
1421+ animation-timing-function: ease-in-out;
1422+ animation-iteration-count: 2;
1423+ animation-direction: alternate;
1424+ animation-play-state: running;
1425+ animation-delay: 100ms;
1426+ animation-fill-mode: forwards;
1427+ }
1428+ "# , indoc ! { r#"
1429+ .foo {
1430+ animation: foo 90ms ease-in-out .1s 2 alternate forwards;
1431+ }
1432+ "# } ) ;
1433+ test ( r#"
1434+ .foo {
1435+ animation-name: foo, bar;
1436+ animation-duration: 0.09s, 200ms;
1437+ animation-timing-function: ease-in-out, ease;
1438+ animation-iteration-count: 2, 1;
1439+ animation-direction: alternate, normal;
1440+ animation-play-state: running, paused;
1441+ animation-delay: 100ms, 0s;
1442+ animation-fill-mode: forwards, none;
1443+ }
1444+ "# , indoc ! { r#"
1445+ .foo {
1446+ animation: foo 90ms ease-in-out .1s 2 alternate forwards, bar .2s paused;
1447+ }
1448+ "# } ) ;
1449+ test ( r#"
1450+ .foo {
1451+ animation: bar 200ms;
1452+ animation-timing-function: ease-in-out;
1453+ }
1454+ "# , indoc ! { r#"
1455+ .foo {
1456+ animation: bar .2s ease-in-out;
1457+ }
1458+ "# } ) ;
1459+ test ( r#"
1460+ .foo {
1461+ animation-name: foo, bar;
1462+ animation-duration: 0.09s;
1463+ animation-timing-function: ease-in-out;
1464+ animation-iteration-count: 2;
1465+ animation-direction: alternate;
1466+ animation-play-state: running;
1467+ animation-delay: 100ms;
1468+ animation-fill-mode: forwards;
1469+ }
1470+ "# , indoc ! { r#"
1471+ .foo {
1472+ animation-name: foo, bar;
1473+ animation-duration: 90ms;
1474+ animation-timing-function: ease-in-out;
1475+ animation-iteration-count: 2;
1476+ animation-direction: alternate;
1477+ animation-play-state: running;
1478+ animation-delay: .1s;
1479+ animation-fill-mode: forwards;
1480+ }
1481+ "# } ) ;
1482+ }
13871483}
0 commit comments