Tests for parsing issue fix

This commit is contained in:
Manuel Ebert 2015-04-05 18:38:37 +02:00
parent b4e578b63a
commit 539a88ed14
4 changed files with 36 additions and 15 deletions

View file

@ -0,0 +1,11 @@
{
"default_hour": 9,
"timeformat": "%Y-%m-%d %H:%M",
"linewrap": 80,
"encrypt": false,
"editor": "",
"default_minute": 0,
"highlight": true,
"journals": {"default": "features/journals/simple_jrnl-1-9-5.journal"},
"tagsymbols": "@"
}

View file

@ -1,5 +1,3 @@
2013-06-09 15:39 My first entry. 2010-06-10 15:00 A life without chocolate is like a bad analogy.
Everything is alright
2013-06-10 15:40 Life is good. 2013-06-10 15:40 He said "[this] is the best time to be alive".
But I'm better.

View file

@ -49,6 +49,16 @@ Feature: Zapped bugs should stay dead.
| Hope to get a lot of traffic. | Hope to get a lot of traffic.
""" """
Scenario: Upgrade and parse journals with square brackets
Given we use the config "upgrade_from_195.json"
When we run "jrnl -2" and enter "Y"
Then the output should contain
"""
2010-06-10 15:00 A life without chocolate is like a bad analogy.
2013-06-10 15:40 He said "[this] is the best time to be alive".
"""
Scenario: Title with an embedded period on DayOne journal Scenario: Title with an embedded period on DayOne journal
Given we use the config "dayone.yaml" Given we use the config "dayone.yaml"
When we run "jrnl 04-24-2014: Ran 6.2 miles today in 1:02:03. I'm feeling sore because I forgot to stretch." When we run "jrnl 04-24-2014: Ran 6.2 miles today in 1:02:03. I'm feeling sore because I forgot to stretch."

View file

@ -162,8 +162,10 @@ def check_output_time_inline(context, text):
assert local_date in out, local_date assert local_date in out, local_date
@then('the output should contain')
@then('the output should contain "{text}"') @then('the output should contain "{text}"')
def check_output_inline(context, text): def check_output_inline(context, text=None):
text = text or context.text
out = context.stdout_capture.getvalue() out = context.stdout_capture.getvalue()
if isinstance(out, bytes): if isinstance(out, bytes):
out = out.decode('utf-8') out = out.decode('utf-8')