Skip to content

Commit 9cbe5b5

Browse files
timidribastelfreak
authored andcommitted
Add invalid escape sequence test
1 parent cea5e19 commit 9cbe5b5

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

tests/invalid_escape_char/Rakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
$LOAD_PATH.unshift(File.expand_path('../../lib', __dir__))
2+
require 'metadata-json-lint/rake_task'

tests/invalid_escape_char/expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Error: Unable to parse metadata.json: Invalid escape character in string
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "puppetlabs-postgresql",
3+
"version": "3.4.1",
4+
"author": "Inkling/Puppet Labs",
5+
"summary": "A description with an invalid \( escape sequence",
6+
"license": "Apache-2.0",
7+
"source": "git://github.com/puppetlabs/puppet-postgresql.git",
8+
"project_page": "https://github.com/puppetlabs/puppet-postgresql",
9+
"issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues",
10+
"operatingsystem_support": [
11+
],
12+
"requirements": [
13+
],
14+
"dependencies": [
15+
]
16+
}

tests/test.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ test "bad_license" $SUCCESS --no-strict-license
103103
# Run with --no-fail-on-warnings, expect SUCCESS
104104
test "bad_license" $SUCCESS --no-fail-on-warnings
105105

106+
# Run a broken one, expect FAILURE
107+
test "invalid_escape_char" $FAILURE
108+
106109
# Run a broken one, expect FAILURE
107110
test "long_summary" $FAILURE
108111

0 commit comments

Comments
 (0)