From a14fd392236f457b843d60c7590618742449991d Mon Sep 17 00:00:00 2001 From: ppizarror Date: Wed, 6 Sep 2023 03:17:36 +0100 Subject: [PATCH] Added underscore support --- pydetex/_symbols.py | 1 + pydetex/version.py | 2 +- test/test_parsers.py | 1 + test/test_pipelines.py | 7 ++----- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pydetex/_symbols.py b/pydetex/_symbols.py index ccc445c..399a806 100644 --- a/pydetex/_symbols.py +++ b/pydetex/_symbols.py @@ -24,6 +24,7 @@ ('---', '—'), ('\#', '#'), ('\&', '&'), + ('\_', '_'), ('~', ' '), ('fi', 'fi') ] diff --git a/pydetex/version.py b/pydetex/version.py index f0741e1..da3e784 100644 --- a/pydetex/version.py +++ b/pydetex/version.py @@ -32,6 +32,6 @@ def __str__(self) -> str: patch = property(lambda self: self[2]) -vernum = Version(1, 0, 3) +vernum = Version(1, 0, 4) ver = str(vernum) rev = '' diff --git a/test/test_parsers.py b/test/test_parsers.py index 8416fda..172b64a 100644 --- a/test/test_parsers.py +++ b/test/test_parsers.py @@ -160,6 +160,7 @@ def test_simple_replace(self) -> None: 'The following example $α₀+β²=0$') self.assertEqual(par.simple_replace('This is a $x_0$ and \(x^2\)'), 'This is a $x₀$ and \(x²\)') self.assertEqual(par.simple_replace('This is $\\alpha$'), 'This is $α$') + self.assertEqual(par.simple_replace('This is \#my\_var'), 'This is #my_var') def test_parse_inputs(self) -> None: """ diff --git a/test/test_pipelines.py b/test/test_pipelines.py index 56708bb..b37d1a2 100644 --- a/test/test_pipelines.py +++ b/test/test_pipelines.py @@ -121,14 +121,11 @@ def test_strict(self) -> None: par._load_file_search('data/example_complex_envs_output.txt')) # Exclusive tests - test_complex = True - if 'GITHUB' in os.environ: - return example_files = [ ('data/example_complex_template.txt', 'data/example_complex_template_output.txt') ] - if not test_complex: - example_files = [] + if not (True and 'GITHUB' not in os.environ): # If not test complex + example_files.clear() for f in example_files: self.assertEqual(pip.strict(par._load_file_search(f[0])), par._load_file_search(f[1]))