def test_todo_with_existing_todo_counter():
    txt = """\
Tasks 🐻 [1/3]
+ 🌈 Task
+ Task two
- Task three"""
    actual = append_todo_count(txt)
    expected = """\
Tasks 🐻 [2/3]
+ 🌈 Task
+ Task two
- Task three"""
    assert actual == expected
def test_simple_todo():
    txt = """\
Tasks
+ Task one
- Task two
- Task three"""
    actual = append_todo_count(txt)
    expected = """\
Tasks [1/3]
+ Task one
- Task two
- Task three"""
    assert actual == expected
def test_todo_with_emoji():
    txt = """\
Tasks 🐻
+ 🌈 Task
- Task two
- Task three"""
    actual = append_todo_count(txt)
    expected = """\
Tasks 🐻 [1/3]
+ 🌈 Task
- Task two
- Task three"""
    assert actual == expected
def test_empty_todo():
    txt = """\
Tasks πŸ™„
+ 
- 
- """  # noqa: W291
    actual = append_todo_count(txt)
    expected = """\
"""
    expected = """\
Tasks πŸ™„ [1/3]
+ 
- 
- """  # noqa: W291
    assert actual == expected
def test_todo_with_subtasks():
    txt = """\
Tasks 🐻
+ 🌈 Task
- Task two
- Task three
	- subtask 1
	- subtask 2"""
    actual = append_todo_count(txt)
    expected = """\
Tasks 🐻 [1/5]
+ 🌈 Task
- Task two
- Task three
	- subtask 1
	- subtask 2"""
    assert actual == expected
def test_todo_with_line_separator():
    txt = """\
# tryme 🐻
- read this
- read this too
---
+ done 1
+ done 2"""
    actual = append_todo_count(txt)
    expected = """\
# tryme 🐻 [2/4]
- read this
- read this too
---
+ done 1
+ done 2"""
    assert actual == expected
def test_todo_with_links():
    txt = """\
Tasks πŸ‘
+ https://good-article.com/1
- https://good-article.com/main
	- https://good-article.com/sub1
	+ https://good-article.com/sub2
+ [Working With XML in Scala - DZone Java](https://dzone.com/articles/working-with-xml-in-scala)
+ [Amundsenβ€Šβ€”β€ŠLyft’s data discovery & metadata engine – Lyft Engineering](https://eng.lyft.com/amundsen-lyfts-data-discovery-metadata-engine-62d27254fbb9)"""  # noqa: E501
    actual = append_todo_count(txt)
    expected = """\
Tasks πŸ‘ [4/6]
+ https://good-article.com/1
- https://good-article.com/main
	- https://good-article.com/sub1
	+ https://good-article.com/sub2
+ [Working With XML in Scala - DZone Java](https://dzone.com/articles/working-with-xml-in-scala)
+ [Amundsenβ€Šβ€”β€ŠLyft’s data discovery & metadata engine – Lyft Engineering](https://eng.lyft.com/amundsen-lyfts-data-discovery-metadata-engine-62d27254fbb9)"""  # noqa: E501
    assert actual == expected
def test_todo_with_plus_signs():
    txt = """\
Tasks with plus signs πŸ˜‚
- + in the beginning of a task
- let's see + in the middle of a task
- what about at the end +
- +
+ + in the beginning of a task
+ let's see + in the middle of a task
+ what about at the end +
+ +"""
    actual = append_todo_count(txt)
    expected = """\
Tasks with plus signs πŸ˜‚ [4/8]
- + in the beginning of a task
- let's see + in the middle of a task
- what about at the end +
- +
+ + in the beginning of a task
+ let's see + in the middle of a task
+ what about at the end +
+ +"""
    assert actual == expected
def test_todo_with_dashes():
    txt = """\
Tasks with dashes πŸ˜‚
- - in the beginning of a task
- let's see - in the middle of a task
- what about at the end -
- -
+ - in the beginning of a task
+ let's see - in the middle of a task
+ what about at the end -
+ -"""
    actual = append_todo_count(txt)
    expected = """\
Tasks with dashes πŸ˜‚ [4/8]
- - in the beginning of a task
- let's see - in the middle of a task
- what about at the end -
- -
+ - in the beginning of a task
+ let's see - in the middle of a task
+ what about at the end -
+ -"""
    assert actual == expected