|
8 | 8 | import 'package:test/test.dart'; |
9 | 9 |
|
10 | 10 | import 'package:sass/sass.dart'; |
| 11 | +import 'package:pub_semver/pub_semver.dart'; |
11 | 12 |
|
12 | 13 | void main() { |
13 | 14 | // Deprecated in all version of Dart Sass |
@@ -151,6 +152,39 @@ void main() { |
151 | 152 | ); |
152 | 153 | }); |
153 | 154 | }); |
| 155 | + |
| 156 | + group('Deprecation.forVersion', () { |
| 157 | + test('excludes deprecations that are obsolete', () { |
| 158 | + final version = Version.parse('1.79.0'); |
| 159 | + final deprecations = Deprecation.forVersion(version); |
| 160 | + |
| 161 | + expect( |
| 162 | + deprecations, |
| 163 | + equals({ |
| 164 | + Deprecation.callString, |
| 165 | + Deprecation.elseif, |
| 166 | + Deprecation.mozDocument, |
| 167 | + Deprecation.relativeCanonical, |
| 168 | + Deprecation.newGlobal, |
| 169 | + Deprecation.colorModuleCompat, |
| 170 | + Deprecation.slashDiv, |
| 171 | + Deprecation.bogusCombinators, |
| 172 | + Deprecation.strictUnary, |
| 173 | + Deprecation.functionUnits, |
| 174 | + Deprecation.duplicateVarFlags, |
| 175 | + Deprecation.nullAlpha, |
| 176 | + Deprecation.absPercent, |
| 177 | + Deprecation.fsImporterCwd, |
| 178 | + Deprecation.cssFunctionMixin, |
| 179 | + Deprecation.featureExists, |
| 180 | + Deprecation.color4Api, |
| 181 | + Deprecation.colorFunctions, |
| 182 | + Deprecation.legacyJsApi |
| 183 | + }), |
| 184 | + reason: 'mixed-decls obsolete as of 1.92.0', |
| 185 | + ); |
| 186 | + }); |
| 187 | + }); |
154 | 188 | } |
155 | 189 |
|
156 | 190 | /// Confirms that [source] will error if [deprecation] is fatal. |
|
0 commit comments