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
a9f7236a
Commit
a9f7236a
authored
Nov 07, 2013
by
Sven Strickroth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a testcase for values which needs quotes
Signed-off-by: Sven Strickroth <email@cs-ware.de>
parent
fde93250
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
tests-clar/config/write.c
+27
-0
No files found.
tests-clar/config/write.c
View file @
a9f7236a
...
@@ -229,6 +229,33 @@ void test_config_write__add_value_at_file_with_no_clrf_at_the_end(void)
...
@@ -229,6 +229,33 @@ void test_config_write__add_value_at_file_with_no_clrf_at_the_end(void)
git_config_free
(
cfg
);
git_config_free
(
cfg
);
}
}
void
test_config_write__add_value_which_needs_quotes
(
void
)
{
git_config
*
cfg
;
const
char
*
str1
;
const
char
*
str2
;
const
char
*
str3
;
const
char
*
str4
;
cl_git_pass
(
git_config_open_ondisk
(
&
cfg
,
"config17"
));
cl_git_pass
(
git_config_set_string
(
cfg
,
"core.startwithspace"
,
" Something"
));
cl_git_pass
(
git_config_set_string
(
cfg
,
"core.endwithspace"
,
"Something "
));
cl_git_pass
(
git_config_set_string
(
cfg
,
"core.containscommentchar1"
,
"some#thing"
));
cl_git_pass
(
git_config_set_string
(
cfg
,
"core.containscommentchar2"
,
"some;thing"
));
git_config_free
(
cfg
);
cl_git_pass
(
git_config_open_ondisk
(
&
cfg
,
"config17"
));
cl_git_pass
(
git_config_get_string
(
&
str1
,
cfg
,
"core.startwithspace"
));
cl_assert_equal_s
(
" Something"
,
str1
);
cl_git_pass
(
git_config_get_string
(
&
str2
,
cfg
,
"core.endwithspace"
));
cl_assert_equal_s
(
"Something "
,
str2
);
cl_git_pass
(
git_config_get_string
(
&
str3
,
cfg
,
"core.containscommentchar1"
));
cl_assert_equal_s
(
"some#thing"
,
str3
);
cl_git_pass
(
git_config_get_string
(
&
str4
,
cfg
,
"core.containscommentchar2"
));
cl_assert_equal_s
(
"some;thing"
,
str4
);
git_config_free
(
cfg
);
}
void
test_config_write__can_set_a_value_to_NULL
(
void
)
void
test_config_write__can_set_a_value_to_NULL
(
void
)
{
{
git_repository
*
repository
;
git_repository
*
repository
;
...
...
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