List for cgit developers and users
 help / color / mirror / Atom feed
From: john at keeping.me.uk (John Keeping)
Subject: [PATCH 1/3] tests: document handling of repository names with spaces
Date: Sun, 12 Mar 2017 15:49:02 +0000	[thread overview]
Message-ID: <db13fe9fe43ffd657fc4a0eef9c9d2ad6944b68f.1489333714.git.john@keeping.me.uk> (raw)

t0103-log.sh has a test to check that we don't properly escape spaces in
repository URLs, but no other tests do.

It turns out that the handling of this case in the index page is broken,
so mark this as test_expect_failure while adding successful tests for
all other pages.

Signed-off-by: John Keeping <john at keeping.me.uk>
---
 tests/t0101-index.sh   | 1 +
 tests/t0102-summary.sh | 7 +++++++
 tests/t0104-tree.sh    | 7 +++++++
 tests/t0105-commit.sh  | 7 +++++++
 tests/t0106-diff.sh    | 7 +++++++
 5 files changed, 29 insertions(+)

diff --git a/tests/t0101-index.sh b/tests/t0101-index.sh
index 82ef9b0..6450b9b 100755
--- a/tests/t0101-index.sh
+++ b/tests/t0101-index.sh
@@ -11,6 +11,7 @@ test_expect_success 'find bar description' 'grep "the bar repo" tmp'
 test_expect_success 'find foo+bar repo' 'grep ">foo+bar<" tmp'
 test_expect_success 'verify foo+bar link' 'grep "/foo+bar/" tmp'
 test_expect_success 'verify "with%20space" link' 'grep "/with%20space/" tmp'
+test_expect_failure 'no links with space in path' '! grep "href=./with space/" tmp'
 test_expect_success 'no tree-link' '! grep "foo/tree" tmp'
 test_expect_success 'no log-link' '! grep "foo/log" tmp'
 
diff --git a/tests/t0102-summary.sh b/tests/t0102-summary.sh
index b8864cb..1d91dca 100755
--- a/tests/t0102-summary.sh
+++ b/tests/t0102-summary.sh
@@ -22,4 +22,11 @@ test_expect_success 'clone-url expanded correctly' '
 	grep "git://example.org/bar.git" tmp
 '
 
+test_expect_success 'generate with-space summary' '
+	cgit_url "with20space" >tmp
+'
+test_expect_success 'no links with space in path' '
+	! grep "href=./with space/" tmp
+'
+
 test_done
diff --git a/tests/t0104-tree.sh b/tests/t0104-tree.sh
index 2e140f5..de8c4f8 100755
--- a/tests/t0104-tree.sh
+++ b/tests/t0104-tree.sh
@@ -29,4 +29,11 @@ test_expect_success 'verify a+b?h=1+2 link' '
 	grep "/foo+bar/tree/a+b?h=1%2b2" tmp
 '
 
+test_expect_success 'generate with%20space/tree' '
+	cgit_url "with%20space/tree" >tmp
+'
+test_expect_success 'no links with space in path' '
+	! grep "href=./with space/" tmp
+'
+
 test_done
diff --git a/tests/t0105-commit.sh b/tests/t0105-commit.sh
index 9cdf55c..1932d5f 100755
--- a/tests/t0105-commit.sh
+++ b/tests/t0105-commit.sh
@@ -33,4 +33,11 @@ test_expect_success 'root commit contains diff' '
 	grep "<div class=.add.>+1</div>" tmp
 '
 
+test_expect_success 'generate with%20space/commit' '
+	cgit_url "with%20space/commit" >tmp
+'
+test_expect_success 'no links with space in path' '
+	! grep "href=./with space/" tmp
+'
+
 test_done
diff --git a/tests/t0106-diff.sh b/tests/t0106-diff.sh
index 82b645e..89532f5 100755
--- a/tests/t0106-diff.sh
+++ b/tests/t0106-diff.sh
@@ -16,4 +16,11 @@ test_expect_success 'find added line' '
 	grep "<div class=.add.>+5</div>" tmp
 '
 
+test_expect_success 'generate with%20space/diff' '
+	cgit_url "with%20space/diff" >tmp
+'
+test_expect_success 'no links with space in path' '
+	! grep "href=./with space/" tmp
+'
+
 test_done
-- 
2.12.0.415.g6c14041932.dirty



             reply	other threads:[~2017-03-12 15:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-12 15:49 john [this message]
2017-03-12 15:49 ` [PATCH 2/3] ui-{repolist,atom}: fix repository URL escaping john
2017-03-12 15:49 ` [PATCH 3/3] html: remove unused functions john

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=db13fe9fe43ffd657fc4a0eef9c9d2ad6944b68f.1489333714.git.john@keeping.me.uk \
    --to=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).