Failed asserting that two strings are equal in a patch I have submit a patch on community but I am getting an error in result that Failed asserting that two strings are equal.
This is the patch.


index 31bf064..fa079cc 100644
--- a/advagg_css_minify/yui/CSSMin.inc
+++ b/advagg_css_minify/yui/CSSMin.inc
@@ -422,7 +422,10 @@ class CSSmin

         // restore preserved comments and strings in reverse order
         for ($i = count($this-&gt;preserved_tokens) - 1; $i &gt;= 0; $i--) {
-            $css = preg_replace('/' . self::TOKEN . $i . '___/', $this-&gt;preserved_tokens[$i], $css, 1);
+            $preserved_tokens = $this-&gt;preserved_tokens[$i];
+            $preserved_tokens = htmlspecialchars($preserved_tokens);
+            $pt_replacepattern =  preg_replace('[^A-Za-z0-9@*.#:/ \-]', '',$preserved_tokens);
+            $css = preg_replace('/' . self::TOKEN . $i . '___/', $pt_replacepattern, $css, 1);
         }

         // Trim the final string (for any leading or trailing white spaces)
@@ -582,7 +585,10 @@ class CSSmin
         // one, maybe more? put'em back then
         if (($pos = $this-&gt;index_of($match, self::COMMENT)) &gt;= 0) {
             for ($i = 0, $max = count($this-&gt;comments); $i &lt; $max; $i++) {
-                $match = preg_replace('/' . self::COMMENT . $i . '___/', $this-&gt;comments[$i], $match, 1);
+                $comment = $this-&gt;comments[$i];
+                $comment = htmlspecialchars($comment);
+                $replacepattern =  preg_replace('/[^A-Za-z0-9@*. \-]/', '',$comment);  
+                $match = preg_replace('/' . self::COMMENT . $i . '___/', $replacepattern, $match, 1);
             }
         }
It looks like the problem might have to do with HTML escape sequences for quotes, ampersands and other meta-characters (at least in part).

Compare these lines:

-  content: '/* \" \' */';\n
+  content: '/* quot  */';\n


and these:

-}"]{color:red}q[style*="quotes: none"]{quotes:none}q[style*='quotes: none']{quotes:none}q:after{content:": colon &amp; escaped double \" quotes \"."}q:after{content:' (brackets &amp; escaped single \' quotes \') '}q:after{content:"I'm Quote"}'
+}"]{color:red}q[style*="quotes: none"]{quotes:none}q[style*='quotes: none']{quotes:none}q:after{content:": colon &amp;amp; escaped double \&amp;quot; quotes \&amp;quot;."}q:after{content:' (brackets &amp;amp; escaped single \' quotes \') '}q:after{content:"I'm Quote"}'


Hopefully that sets you on the right path. Don't just look at your diff, look at the PHPUnit test to see exactly what test you are failing. Good luck!