From 58daab21cd043e1dc37024a7f99b396788372918 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 9 Mar 2024 14:19:48 +0100 Subject: Merging upstream version 1.44.3. Signed-off-by: Daniel Baumann --- .../libh2o/deps/mruby-file-stat/test/file-stat.c | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 web/server/h2o/libh2o/deps/mruby-file-stat/test/file-stat.c (limited to 'web/server/h2o/libh2o/deps/mruby-file-stat/test/file-stat.c') diff --git a/web/server/h2o/libh2o/deps/mruby-file-stat/test/file-stat.c b/web/server/h2o/libh2o/deps/mruby-file-stat/test/file-stat.c new file mode 100644 index 000000000..4e596648d --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby-file-stat/test/file-stat.c @@ -0,0 +1,30 @@ +#include +#include + +static mrb_value +test_system(mrb_state *mrb, mrb_value klass) +{ + char *cmd = NULL; + mrb_get_args(mrb, "z", &cmd); + system(cmd); + return mrb_nil_value(); +} + +static mrb_value +test_win_p(mrb_state *mrb, mrb_value klass) +{ +#if defined(_WIN32) + return mrb_true_value(); +#else + return mrb_false_value(); +#endif +} + +void mrb_mruby_file_stat_gem_test(mrb_state *mrb) +{ + struct RClass *t; + + t = mrb_define_class(mrb, "FileStatTest", mrb->object_class); + mrb_define_module_function(mrb, t, "system", test_system, MRB_ARGS_REQ(1)); + mrb_define_module_function(mrb, t, "win?", test_win_p, MRB_ARGS_NONE()); +} -- cgit v1.2.3