Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
17623fd0
Unverified
Commit
17623fd0
authored
Aug 25, 2019
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
Aug 25, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4665 from dearblue/fix-4642
Create a symbolic link in the temporary directory; fix #4642
parents
ce899746
6ad2442f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
28 deletions
+17
-28
mrbgems/mruby-io/test/file.rb
mrbgems/mruby-io/test/file.rb
+17
-12
mrbgems/mruby-io/test/mruby_io_test.c
mrbgems/mruby-io/test/mruby_io_test.c
+0
-16
No files found.
mrbgems/mruby-io/test/file.rb
View file @
17623fd0
...
@@ -179,20 +179,25 @@ end
...
@@ -179,20 +179,25 @@ end
assert
(
'File.symlink'
)
do
assert
(
'File.symlink'
)
do
target_name
=
"/usr/bin"
target_name
=
"/usr/bin"
symlink_name
=
MRubyIOTestUtil
.
mktemp
(
"test-bin-dummy-XXXXXXXX"
)
if
!
File
.
exist?
(
target_name
)
if
!
File
.
exist?
(
target_name
)
skip
(
"target directory of File.symlink is not found"
)
skip
(
"target directory of File.symlink is not found"
)
else
end
begin
begin
assert_equal
0
,
File
.
symlink
(
target_name
,
symlink_name
)
tmpdir
=
MRubyIOTestUtil
.
mkdtemp
(
"mruby-io-test.XXXXXX"
)
rescue
=>
e
skip
e
.
message
end
symlink_name
=
"
#{
tmpdir
}
/test-bin-dummy"
begin
begin
assert_equal
0
,
File
.
symlink
(
target_name
,
symlink_name
)
assert_equal
true
,
File
.
symlink?
(
symlink_name
)
assert_equal
true
,
File
.
symlink?
(
symlink_name
)
ensure
File
.
delete
symlink_name
end
rescue
NotImplementedError
=>
e
rescue
NotImplementedError
=>
e
skip
e
.
message
skip
e
.
message
end
ensure
File
.
delete
symlink_name
rescue
nil
MRubyIOTestUtil
.
rmdir
tmpdir
rescue
nil
end
end
end
end
...
...
mrbgems/mruby-io/test/mruby_io_test.c
View file @
17623fd0
...
@@ -44,7 +44,6 @@ mkdtemp(char *temp)
...
@@ -44,7 +44,6 @@ mkdtemp(char *temp)
return
path
;
return
path
;
}
}
#define mktemp(path) _mktemp(path)
#define umask(mode) _umask(mode)
#define umask(mode) _umask(mode)
#define rmdir(path) _rmdir(path)
#define rmdir(path) _rmdir(path)
#else
#else
...
@@ -199,20 +198,6 @@ mrb_io_test_file_cleanup(mrb_state *mrb, mrb_value self)
...
@@ -199,20 +198,6 @@ mrb_io_test_file_cleanup(mrb_state *mrb, mrb_value self)
return
mrb_nil_value
();
return
mrb_nil_value
();
}
}
static
mrb_value
mrb_io_test_mktemp
(
mrb_state
*
mrb
,
mrb_value
klass
)
{
mrb_value
str
;
char
*
cp
;
mrb_get_args
(
mrb
,
"S"
,
&
str
);
cp
=
mrb_str_to_cstr
(
mrb
,
str
);
if
(
mktemp
(
cp
)
==
NULL
)
{
mrb_sys_fail
(
mrb
,
"mktemp"
);
}
return
mrb_str_new_cstr
(
mrb
,
cp
);
}
static
mrb_value
static
mrb_value
mrb_io_test_mkdtemp
(
mrb_state
*
mrb
,
mrb_value
klass
)
mrb_io_test_mkdtemp
(
mrb_state
*
mrb
,
mrb_value
klass
)
{
{
...
@@ -263,7 +248,6 @@ mrb_mruby_io_gem_test(mrb_state* mrb)
...
@@ -263,7 +248,6 @@ mrb_mruby_io_gem_test(mrb_state* mrb)
mrb_define_class_method
(
mrb
,
io_test
,
"file_test_setup"
,
mrb_io_test_file_setup
,
MRB_ARGS_NONE
());
mrb_define_class_method
(
mrb
,
io_test
,
"file_test_setup"
,
mrb_io_test_file_setup
,
MRB_ARGS_NONE
());
mrb_define_class_method
(
mrb
,
io_test
,
"file_test_cleanup"
,
mrb_io_test_file_cleanup
,
MRB_ARGS_NONE
());
mrb_define_class_method
(
mrb
,
io_test
,
"file_test_cleanup"
,
mrb_io_test_file_cleanup
,
MRB_ARGS_NONE
());
mrb_define_class_method
(
mrb
,
io_test
,
"mktemp"
,
mrb_io_test_mktemp
,
MRB_ARGS_REQ
(
1
));
mrb_define_class_method
(
mrb
,
io_test
,
"mkdtemp"
,
mrb_io_test_mkdtemp
,
MRB_ARGS_REQ
(
1
));
mrb_define_class_method
(
mrb
,
io_test
,
"mkdtemp"
,
mrb_io_test_mkdtemp
,
MRB_ARGS_REQ
(
1
));
mrb_define_class_method
(
mrb
,
io_test
,
"rmdir"
,
mrb_io_test_rmdir
,
MRB_ARGS_REQ
(
1
));
mrb_define_class_method
(
mrb
,
io_test
,
"rmdir"
,
mrb_io_test_rmdir
,
MRB_ARGS_REQ
(
1
));
mrb_define_class_method
(
mrb
,
io_test
,
"win?"
,
mrb_io_win_p
,
MRB_ARGS_NONE
());
mrb_define_class_method
(
mrb
,
io_test
,
"win?"
,
mrb_io_win_p
,
MRB_ARGS_NONE
());
...
...
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