Skip to content

Commit

Permalink
Update tests: git status uses -z now
Browse files Browse the repository at this point in the history
Before #1033 we did a mixture of '-z' calls and non '-z' calls.
Using '-z' means git will output '\x00' control chars instead
of (more human readable) '\n's.
  • Loading branch information
kaste committed Dec 12, 2018
1 parent 504cc3f commit bb8c4e8
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions tests/test_repo_status.py
Expand Up @@ -15,59 +15,59 @@
"optimize-status-interface"
),
(
"## optimize-status-interface\n",
"## optimize-status-interface\x00",
"optimize-status-interface"
),
(
"## optimize-status-interface\n?? foo.txt",
"## optimize-status-interface\x00?? foo.txt",
"optimize-status-interface*"
),
(
"## optimize-status-interface...fork/branch-name [ahead 1]",
"optimize-status-interface+1"
),
(
"## optimize-status-interface...fork/branch-name [ahead 1]\n?? foo.txt",
"## optimize-status-interface...fork/branch-name [ahead 1]\x00?? foo.txt",
"optimize-status-interface*+1"
),
(
"## dev...origin/dev [behind 7]",
"dev-7"
),
(
"## dev...origin/dev [behind 7]\n?? foo.txt",
"## dev...origin/dev [behind 7]\x00?? foo.txt",
"dev*-7"
),
(
"## optimize-status-interface...fork/branch-name [ahead 1, behind 2]",
"optimize-status-interface+1-2"
),
(
"## optimize-status-interface...fork/branch-name [ahead 1, behind 2]\nM foo",
"## optimize-status-interface...fork/branch-name [ahead 1, behind 2]\x00M foo",
"optimize-status-interface*+1-2"
),
(
"## improve-diff-view...fork/improve-diff-view [gone]",
"improve-diff-view"
),
(
"## improve-diff-view...fork/improve-diff-view [gone]\n?? foo",
"## improve-diff-view...fork/improve-diff-view [gone]\x00?? foo",
"improve-diff-view*"
),
(
"## HEAD (no branch)",
"DETACHED"
),
(
"## HEAD (no branch)\n?? foo",
"## HEAD (no branch)\x00?? foo",
"DETACHED*"
),
(
"## No commits yet on master",
"master"
),
(
"## No commits yet on master\n?? foo",
"## No commits yet on master\x00?? foo",
"master*"
),
# Previous versions of git instead emitted this before the initial commit
Expand All @@ -76,7 +76,7 @@
"zoom"
),
(
"## Initial commit on master\n?? foo",
"## Initial commit on master\x00?? foo",
"master*"
),
]
Expand Down Expand Up @@ -109,11 +109,11 @@ def test_format_branch_status_for_statusbar(self, status_lines, expected):
"On branch `optimize-status-interface`."
),
(
"## optimize-status-interface\n",
"## optimize-status-interface\x00",
"On branch `optimize-status-interface`."
),
(
"## optimize-status-interface\n?? foo.txt",
"## optimize-status-interface\x00?? foo.txt",
"On branch `optimize-status-interface`."
),
(
Expand All @@ -128,7 +128,7 @@ def test_format_branch_status_for_statusbar(self, status_lines, expected):
""".rstrip())
),
(
"## optimize-status-interface...fork/branch-name [ahead 1]\n?? foo.txt",
"## optimize-status-interface...fork/branch-name [ahead 1]\x00?? foo.txt",
dedent("""\
On branch `optimize-status-interface` tracking `fork/branch-name`.
You're ahead by 1.
Expand All @@ -142,7 +142,7 @@ def test_format_branch_status_for_statusbar(self, status_lines, expected):
""".rstrip())
),
(
"## dev...origin/dev [behind 7]\n?? foo.txt",
"## dev...origin/dev [behind 7]\x00?? foo.txt",
dedent("""\
On branch `dev` tracking `origin/dev`.
You're behind by 7.
Expand All @@ -156,7 +156,7 @@ def test_format_branch_status_for_statusbar(self, status_lines, expected):
""".rstrip())
),
(
"## optimize-status-interface...fork/branch-name [ahead 1, behind 2]\nM foo",
"## optimize-status-interface...fork/branch-name [ahead 1, behind 2]\x00M foo",
dedent("""\
On branch `optimize-status-interface` tracking `fork/branch-name`.
You're ahead by 1 and behind by 2.
Expand All @@ -170,7 +170,7 @@ def test_format_branch_status_for_statusbar(self, status_lines, expected):
""".rstrip())
),
(
"## improve-diff-view...fork/improve-diff-view [gone]\n?? foo",
"## improve-diff-view...fork/improve-diff-view [gone]\x00?? foo",
dedent("""\
On branch `improve-diff-view` tracking `fork/improve-diff-view`.
The remote branch is gone.
Expand All @@ -181,15 +181,15 @@ def test_format_branch_status_for_statusbar(self, status_lines, expected):
"HEAD is in a detached state."
),
(
"## HEAD (no branch)\n?? foo",
"## HEAD (no branch)\x00?? foo",
"HEAD is in a detached state."
),
(
"## No commits yet on master",
"On branch `master`."
),
(
"## No commits yet on master\n?? foo",
"## No commits yet on master\x00?? foo",
"On branch `master`."
),
# Previous versions of git instead emitted this before the initial commit
Expand All @@ -198,7 +198,7 @@ def test_format_branch_status_for_statusbar(self, status_lines, expected):
"On branch `zoom`."
),
(
"## Initial commit on master\n?? foo",
"## Initial commit on master\x00?? foo",
"On branch `master`."
),
]
Expand Down

0 comments on commit bb8c4e8

Please sign in to comment.