Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
a447a7e4
Commit
a447a7e4
authored
Oct 04, 2014
by
Linquize
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config: Add test cases that have trailing spaces before comment chars
parent
0a641647
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
tests/config/stress.c
+12
-0
tests/resources/config/config12
+6
-0
No files found.
tests/config/stress.c
View file @
a447a7e4
...
@@ -44,12 +44,24 @@ void test_config_stress__comments(void)
...
@@ -44,12 +44,24 @@ void test_config_stress__comments(void)
cl_git_pass
(
git_config_open_ondisk
(
&
config
,
cl_fixture
(
"config/config12"
)));
cl_git_pass
(
git_config_open_ondisk
(
&
config
,
cl_fixture
(
"config/config12"
)));
cl_git_pass
(
git_config_get_string
(
&
str
,
config
,
"some.section.test2"
));
cl_assert_equal_s
(
"hello"
,
str
);
cl_git_pass
(
git_config_get_string
(
&
str
,
config
,
"some.section.test3"
));
cl_assert_equal_s
(
"welcome"
,
str
);
cl_git_pass
(
git_config_get_string
(
&
str
,
config
,
"some.section.other"
));
cl_git_pass
(
git_config_get_string
(
&
str
,
config
,
"some.section.other"
));
cl_assert_equal_s
(
"hello!
\"
; ; ; "
,
str
);
cl_assert_equal_s
(
"hello!
\"
; ; ; "
,
str
);
cl_git_pass
(
git_config_get_string
(
&
str
,
config
,
"some.section.other2"
));
cl_assert_equal_s
(
"cool!
\"
# # # "
,
str
);
cl_git_pass
(
git_config_get_string
(
&
str
,
config
,
"some.section.multi"
));
cl_git_pass
(
git_config_get_string
(
&
str
,
config
,
"some.section.multi"
));
cl_assert_equal_s
(
"hi, this is a ; multiline comment # with ;
\n
special chars and other stuff !@#"
,
str
);
cl_assert_equal_s
(
"hi, this is a ; multiline comment # with ;
\n
special chars and other stuff !@#"
,
str
);
cl_git_pass
(
git_config_get_string
(
&
str
,
config
,
"some.section.multi2"
));
cl_assert_equal_s
(
"good, this is a ; multiline comment # with ;
\n
special chars and other stuff !@#"
,
str
);
cl_git_pass
(
git_config_get_string
(
&
str
,
config
,
"some.section.back"
));
cl_git_pass
(
git_config_get_string
(
&
str
,
config
,
"some.section.back"
));
cl_assert_equal_s
(
"this is
\b
a phrase"
,
str
);
cl_assert_equal_s
(
"this is
\b
a phrase"
,
str
);
...
...
tests/resources/config/config12
View file @
a447a7e4
[some "section"]
[some "section"]
test = hi ; comment
test = hi ; comment
test2 = hello ; comment
test3 = welcome #comment
other = "hello! \" ; ; ; " ; more test
other = "hello! \" ; ; ; " ; more test
other2 = "cool! \" # # # " # more test
multi = "hi, this is a ; \
multi = "hi, this is a ; \
multiline comment # with ;\n special chars \
multiline comment # with ;\n special chars \
and other stuff !@#"
and other stuff !@#"
multi2 = "good, this is a ; \
multiline comment # with ;\n special chars \
and other stuff !@#" #^^^
back = "this is \ba phrase"
back = "this is \ba phrase"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment