|
17 | 17 | package com.google.javascript.jscomp; |
18 | 18 |
|
19 | 19 | import static com.google.common.collect.ImmutableList.toImmutableList; |
20 | | -import static com.google.common.truth.Truth.assertThat; |
21 | 20 | import static com.google.javascript.jscomp.CompilerTestCase.srcs; |
22 | 21 | import static java.util.stream.Collectors.joining; |
23 | 22 |
|
@@ -255,79 +254,6 @@ private ImmutableList<Path> listFiles(Path dir) { |
255 | 254 | } |
256 | 255 | } |
257 | 256 |
|
258 | | - @Test |
259 | | - public void testSupportsDebugLogging() { |
260 | | - enableDebugLogging(true); |
261 | | - testNoWarning(closureUnaware("console.log(0 + 1);")); |
262 | | - |
263 | | - Path dir = |
264 | | - Path.of( |
265 | | - this.getLastCompiler().getOptions().getDebugLogDirectory().toString(), |
266 | | - TranspileAndOptimizeClosureUnaware.class.getSimpleName()); |
267 | | - assertThat(listFiles(dir)).isNotEmpty(); |
268 | | - } |
269 | | - |
270 | | - @Test |
271 | | - public void testSupportsPrintingSourceAfterEachPass() { |
272 | | - enableDebugLogging(true); |
273 | | - this.extraOptions = |
274 | | - (CompilerOptions options) -> { |
275 | | - options.setPrintSourceAfterEachPass(true); |
276 | | - options.setInputDelimiter("~~test123~ : %name%"); |
277 | | - options.setPrintInputDelimiter(true); |
278 | | - }; |
279 | | - |
280 | | - testNoWarning(closureUnaware("console.log(0 + 1);")); |
281 | | - |
282 | | - Path dir = |
283 | | - Path.of( |
284 | | - this.getLastCompiler().getOptions().getDebugLogDirectory().toString(), |
285 | | - TranspileAndOptimizeClosureUnaware.class.getSimpleName()); |
286 | | - var firstSource = loadFile(dir.resolve("Compiler/source_after_pass/000_parseInputs")); |
287 | | - assertThat(firstSource) |
288 | | - .isEqualTo( |
289 | | - """ |
290 | | - ~~test123~ : synthetic_base |
291 | | - 'use strict'; |
292 | | - ~~test123~ : testcode.shadow0 |
293 | | - $jscomp_sink_closure_unaware_impl(function(){console.log(0+1)});\ |
294 | | - """); |
295 | | - } |
296 | | - |
297 | | - @Test |
298 | | - public void testSupportsPrintingSourceAfterEachPass_withRegexpFilter() { |
299 | | - enableDebugLogging(true); |
300 | | - this.extraOptions = |
301 | | - (CompilerOptions options) -> { |
302 | | - options.setPrintSourceAfterEachPass(true); |
303 | | - options.setPrettyPrint(true); |
304 | | - options.setFilesToPrintAfterEachPassRegexList(ImmutableList.of(".*shadow1")); |
305 | | - }; |
306 | | - |
307 | | - testNoWarning( |
308 | | - srcs( |
309 | | - closureUnaware("log('0.0');", "log('0.1');", "log('0.2');"), |
310 | | - closureUnaware("log('1.0');", "log('1.1');", "log('1.2');"))); |
311 | | - |
312 | | - Path dir = |
313 | | - Path.of( |
314 | | - this.getLastCompiler().getOptions().getDebugLogDirectory().toString(), |
315 | | - TranspileAndOptimizeClosureUnaware.class.getSimpleName()); |
316 | | - var firstSource = loadFile(dir.resolve("Compiler/source_after_pass/000_parseInputs")); |
317 | | - assertThat(firstSource) |
318 | | - .isEqualTo( |
319 | | - """ |
320 | | - // testcode0.shadow1 |
321 | | - $jscomp_sink_closure_unaware_impl(function() { |
322 | | - log("0.1"); |
323 | | - }); |
324 | | - // testcode1.shadow1 |
325 | | - $jscomp_sink_closure_unaware_impl(function() { |
326 | | - log("1.1"); |
327 | | - }); |
328 | | - """); |
329 | | - } |
330 | | - |
331 | 257 | private String closureUnaware(String... closureUnaware) { |
332 | 258 | String prefix = |
333 | 259 | String.format( |
|
0 commit comments