From c3abcd4a55745169894af20444974ac7099326a6 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Wed, 23 May 2018 23:11:20 -0400 Subject: [PATCH] Add an auto-generated header --- build_tests.py | 15 +++++++++++---- src/tests/compat_parse.rs | 4 ++++ src/tests/compat_split_string.rs | 4 ++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/build_tests.py b/build_tests.py index 4045f14..af5e175 100644 --- a/build_tests.py +++ b/build_tests.py @@ -10,6 +10,13 @@ TEST_STRINGS = [ 'Mar. 5, 2018', ] +AUTOGEN_HEADER = ''' +// WARNING +// This file was auto-generated using the `build_tests.py` script. +// Please do not edit it manually. + +''' + S4 = ' ' * 4 S8 = ' ' * 8 S12 = ' ' * 12 @@ -31,8 +38,8 @@ def rust_tokenize(time_string): return [translate_token(t) for t in split_array] def build_split_string_tests(): - header = '''use ::Token; -use ::tokenize; + header = '''use Token; +use tokenize; #[test] fn test_python_compat() {\n''' @@ -76,8 +83,8 @@ fn test_python_compat() {\n''' if __name__ == '__main__': split_string_test = build_split_string_tests() with open('src/tests/compat_split_string.rs', 'w+') as handle: - handle.write(split_string_test) + handle.write(AUTOGEN_HEADER + split_string_test) parse_test = build_parse_tests() with open('src/tests/compat_parse.rs', 'w+') as handle: - handle.write(parse_test) \ No newline at end of file + handle.write(AUTOGEN_HEADER + parse_test) \ No newline at end of file diff --git a/src/tests/compat_parse.rs b/src/tests/compat_parse.rs index af86796..240e622 100644 --- a/src/tests/compat_parse.rs +++ b/src/tests/compat_parse.rs @@ -1,3 +1,7 @@ +// WARNING +// This file was auto-generated using the `build_tests.py` script. +// Please do not edit it manually. + use chrono::SecondsFormat; use parse; diff --git a/src/tests/compat_split_string.rs b/src/tests/compat_split_string.rs index 68a3a4c..69ad3e4 100644 --- a/src/tests/compat_split_string.rs +++ b/src/tests/compat_split_string.rs @@ -1,3 +1,7 @@ +// WARNING +// This file was auto-generated using the `build_tests.py` script. +// Please do not edit it manually. + use Token; use tokenize;