[PATCH] D107954: [Flang] test_symbols.py formatting fix

Ivan Zhechev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 17 01:53:58 PDT 2021


ijan1 updated this revision to Diff 366836.
ijan1 added a comment.

Updated to use `join` with `unified_diff`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107954/new/

https://reviews.llvm.org/D107954

Files:
  flang/test/Semantics/test_symbols.py


Index: flang/test/Semantics/test_symbols.py
===================================================================
--- flang/test/Semantics/test_symbols.py
+++ flang/test/Semantics/test_symbols.py
@@ -4,7 +4,7 @@
 we get the right symbols in the output, i.e. the output should be
 the same as the input, except for the copyright comment.
 Expects a source file passed as the first argument;
-Expects the Flang frontdriver with options as second argument."""
+Expects the Flang frontend driver with options as second argument."""
 
 import sys
 import re
@@ -44,9 +44,8 @@
 diff_check = ""
 
 # Compares the input with the output
-for line in unified_diff(diff1, diff3, n=999999,
-                         fromfile="Expected output", tofile="Actual output"):
-    diff_check += line
+diff_check = "\n".join(unified_diff(diff1.split("\n"), diff3.split("\n"), n=999999,
+                       fromfile="Expected_output", tofile="Actual_output"))
 
 if diff_check != "":
     print(diff_check.replace(" ", ""))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107954.366836.patch
Type: text/x-patch
Size: 1005 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210817/3d5799c2/attachment.bin>


More information about the llvm-commits mailing list