summaryrefslogtreecommitdiff
path: root/test/DocTests.py
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2015-02-08 12:49:04 -0700
committerCraig Earls <enderw88@gmail.com>2015-02-08 12:49:04 -0700
commitfe48f607be7b9da8d2c4ac1fb30078dea55b8240 (patch)
tree252237bce18eb4a5e27246ea5cd197e58be4d7f4 /test/DocTests.py
parent204568d5145c77b3cf3bccd49c9ad6780b4b1fe1 (diff)
parentbc487be14bd1a79cbbedb9203921b357ced79ef7 (diff)
downloadfork-ledger-fe48f607be7b9da8d2c4ac1fb30078dea55b8240.tar.gz
fork-ledger-fe48f607be7b9da8d2c4ac1fb30078dea55b8240.tar.bz2
fork-ledger-fe48f607be7b9da8d2c4ac1fb30078dea55b8240.zip
Merge commit 'bc487be14bd1a79cbbedb9203921b357ced79ef7' into next
Diffstat (limited to 'test/DocTests.py')
-rwxr-xr-xtest/DocTests.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/DocTests.py b/test/DocTests.py
index d3434b43..cbad9ca7 100755
--- a/test/DocTests.py
+++ b/test/DocTests.py
@@ -4,6 +4,7 @@
import os
import re
import sys
+import shlex
import hashlib
import argparse
import subprocess
@@ -33,6 +34,7 @@ class DocTests:
line = self.file.readline()
self.current_line += 1
if len(line) <= 0 or endexample.match(line): break
+ # Replace special texinfo character sequences with their ASCII counterpart
example += line.replace("@@","@").replace("@{","{").replace("@}","}")
return example
@@ -111,11 +113,11 @@ class DocTests:
else:
return None
- command = command.rstrip().split()
+ command = shlex.split(command)
if command[0] == '$': command.remove('$')
index = command.index('ledger')
command[index] = self.ledger
- for i,argument in enumerate('--args-only --columns 80'.split()):
+ for i,argument in enumerate(shlex.split('--args-only --columns 80')):
command.insert(index+i+1, argument)
try: