summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/regex_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-30 16:57:06 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-30 16:57:06 +0000
commitb4cf4027c64afc4f009452a9bfade231e2ff421a (patch)
treecfa307b5d1583471285709032f559ab2ac4be1d5 /spec/lib/gitlab/regex_spec.rb
parent0cb369aa5f70b59e5922d8f5431a3302fd93574e (diff)
downloadgitlab-ce-b4cf4027c64afc4f009452a9bfade231e2ff421a.tar.gz
Add latest changes from gitlab-org/security/gitlab@13-5-stable-ee
Diffstat (limited to 'spec/lib/gitlab/regex_spec.rb')
-rw-r--r--spec/lib/gitlab/regex_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/lib/gitlab/regex_spec.rb b/spec/lib/gitlab/regex_spec.rb
index 66ed80a7d61..451526021c1 100644
--- a/spec/lib/gitlab/regex_spec.rb
+++ b/spec/lib/gitlab/regex_spec.rb
@@ -368,6 +368,21 @@ RSpec.describe Gitlab::Regex do
it { is_expected.not_to match('%2e%2e%2f1.2.3') }
end
+ describe '.nuget_package_name_regex' do
+ subject { described_class.nuget_package_name_regex }
+
+ it { is_expected.to match('My.Package') }
+ it { is_expected.to match('My.Package.Mvc') }
+ it { is_expected.to match('MyPackage') }
+ it { is_expected.to match('My.23.Package') }
+ it { is_expected.to match('My23Package') }
+ it { is_expected.to match('runtime.my-test64.runtime.package.Mvc') }
+ it { is_expected.to match('my_package') }
+ it { is_expected.not_to match('My/package') }
+ it { is_expected.not_to match('../../../my_package') }
+ it { is_expected.not_to match('%2e%2e%2fmy_package') }
+ end
+
describe '.pypi_version_regex' do
subject { described_class.pypi_version_regex }