@@ -114,26 +114,17 @@ def _norm_output(css)
114
114
# but make sure we do not remove single cariage returns
115
115
css = css . gsub ( /(?:\r ?\n )+/ , "\n " )
116
116
end
117
- def _norm_error ( err )
118
- # we dont want to test for linux or windows line-feeds
119
- # but make sure we do not remove single cariage returns
120
- err = err . gsub ( /(?:\r ?\n )+/ , "\n " )
121
- # remove all newlines at the end of the file
122
- err = err . sub ( /(?:\r ?\n )+\z / , "" )
123
- end
124
117
125
118
# cleaning only happens when requested for test
126
119
# done by creating `expected.type.clean` flag file
127
120
def _clean_output ( css )
128
- css . gsub ( / *\{ / , " {\n " )
129
- . gsub ( /([;,]) */ , "\\ 1\n " )
130
- . gsub ( / *\} */ , " }\n " )
131
- . gsub ( /;(?:\s *;)+/m , ";" )
132
- . gsub ( /;\r ?\n }/m , " }" )
133
- . gsub ( /\r ?\n / , "\n " )
134
- . sub ( /(?:\r ?\n )+\z / , "" )
135
- . strip
121
+ _norm_output ( css )
122
+ . gsub ( /[\r \n \s ]+/ , " " )
123
+ . gsub ( /, / , "," )
136
124
end
125
+
126
+ # errors are always cleaned
127
+ # we also write them cleaned
137
128
def _clean_error ( err )
138
129
err . gsub ( /(?:\/ todo_|_todo\/ )/ , "/" ) # hide todo pre/suffix
139
130
. gsub ( /\/ libsass\- [a-z]+\- tests\/ / , "/" ) # hide test directory
0 commit comments