]> git.lyx.org Git - features.git/commitdiff
tex2lyx roundtrip: ignore version string while comparing lyx files
authorKornel Benko <kornel@lyx.org>
Sun, 4 Aug 2013 14:47:03 +0000 (16:47 +0200)
committerKornel Benko <kornel@lyx.org>
Sun, 4 Aug 2013 14:47:03 +0000 (16:47 +0200)
src/tex2lyx/test/runtests.py

index 5a279ded3b5d8399a08dd4cf053631eaa4d8405e..b8a658404b934b462f895c03b3f889d396f54826 100755 (executable)
@@ -21,7 +21,7 @@ def usage(prog_name):
   return "Usage: %s [uselyx2lyx] [<tex2lyx binary> [[<script dir>] [[<output dir>] [testfile]]]]" % prog_name
 
 pat_fl1 = re.compile(r'^#LyX file created by tex2lyx .*$')
-pat_fl2 = re.compile(r'^#LyX 2\.1 created this file.*$')
+pat_fl2 = re.compile(r'^#LyX \d+\.\d+ created this file.*$')
 
 def compareLyx(lines1, lines2):
     if lines1[1:] != lines2[1:]:
@@ -123,8 +123,7 @@ def main(argv):
                     lines2 = f2.readlines()
                     f1.close()
                     f2.close()
-                    # ignore the first lone
-                    # e.g. the version of lyx
+                    # ignore the first line e.g. the version of lyx
                     if not compareLyx(lines1, lines2):
                         diff = difflib.unified_diff(lines1, lines2, lyxfile1, lyxfile2, t1, t2)
                         sys.stdout.writelines(diff)