From 68b6846fa6c7b630cc8dab7a8474dcc34e4d67d4 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 22 Nov 2019 15:06:39 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/lib/gitlab/regex_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec/lib/gitlab/regex_spec.rb') diff --git a/spec/lib/gitlab/regex_spec.rb b/spec/lib/gitlab/regex_spec.rb index 1397add9f5a..c580b46cf8d 100644 --- a/spec/lib/gitlab/regex_spec.rb +++ b/spec/lib/gitlab/regex_spec.rb @@ -61,6 +61,12 @@ describe Gitlab::Regex do it { is_expected.to match('my/image') } it { is_expected.to match('my/awesome/image-1') } it { is_expected.to match('my/awesome/image.test') } + it { is_expected.to match('my/awesome/image--test') } + # docker distribution allows for infinite `-` + # https://github.com/docker/distribution/blob/master/reference/regexp.go#L13 + # but we have a range of 0,10 to add a reasonable limit. + it { is_expected.not_to match('my/image-----------test') } + it { is_expected.not_to match('my/image-.test') } it { is_expected.not_to match('.my/image') } it { is_expected.not_to match('my/image.') } end -- cgit v1.2.3