|
17 | 17 | package com.google.javascript.jscomp;
|
18 | 18 |
|
19 | 19 | import static com.google.common.truth.Truth.assertThat;
|
20 |
| -import static java.nio.charset.StandardCharsets.US_ASCII; |
21 | 20 |
|
22 | 21 | import com.google.common.collect.ImmutableMap;
|
23 | 22 | import com.google.javascript.jscomp.CompilerOptions.BrowserFeaturesetYear;
|
|
26 | 25 | import com.google.javascript.jscomp.parsing.parser.FeatureSet.Feature;
|
27 | 26 | import com.google.javascript.rhino.Node;
|
28 | 27 | import com.google.javascript.rhino.Token;
|
29 |
| -import java.io.ByteArrayInputStream; |
30 |
| -import java.io.ByteArrayOutputStream; |
31 | 28 | import java.util.regex.Pattern;
|
32 | 29 | import org.junit.Test;
|
33 | 30 | import org.junit.runner.RunWith;
|
@@ -157,31 +154,6 @@ public void testEmitUseStrictWorksInEs3() {
|
157 | 154 | assertThat(options.shouldEmitUseStrict()).isTrue();
|
158 | 155 | }
|
159 | 156 |
|
160 |
| - @Test |
161 |
| - public void testSerialization() throws Exception { |
162 |
| - CompilerOptions options = new CompilerOptions(); |
163 |
| - options.setDefineToBooleanLiteral("trueVar", true); |
164 |
| - options.setDefineToBooleanLiteral("falseVar", false); |
165 |
| - options.setDefineToNumberLiteral("threeVar", 3); |
166 |
| - options.setDefineToStringLiteral("strVar", "str"); |
167 |
| - options.setAmbiguateProperties(false); |
168 |
| - options.setOutputCharset(US_ASCII); |
169 |
| - |
170 |
| - ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
171 |
| - options.serialize(byteArrayOutputStream); |
172 |
| - |
173 |
| - options = |
174 |
| - CompilerOptions.deserialize(new ByteArrayInputStream(byteArrayOutputStream.toByteArray())); |
175 |
| - |
176 |
| - ImmutableMap<String, Node> actual = options.getDefineReplacements(); |
177 |
| - assertEquivalent(new Node(Token.TRUE), actual.get("trueVar")); |
178 |
| - assertEquivalent(new Node(Token.FALSE), actual.get("falseVar")); |
179 |
| - assertEquivalent(Node.newNumber(3), actual.get("threeVar")); |
180 |
| - assertEquivalent(Node.newString("str"), actual.get("strVar")); |
181 |
| - assertThat(options.shouldAmbiguateProperties()).isFalse(); |
182 |
| - assertThat(options.getOutputCharset()).isEqualTo(US_ASCII); |
183 |
| - } |
184 |
| - |
185 | 157 | @Test
|
186 | 158 | public void testRemoveRegexFromPath() {
|
187 | 159 | CompilerOptions options = new CompilerOptions();
|
|
0 commit comments