summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-28 23:14:30 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2026-04-09 12:18:32 +0900
commitf104525c71fbd6338e98050201253f2fe464ec9b (patch)
treef5963647cb52133dc1ca8ea5e53d87415e510f66 /test
parenta4fa75ee73d0b017a6ac3879844d42fadd2760db (diff)
mkmf: cpp_command in C++ mode
Diffstat (limited to 'test')
-rw-r--r--test/mkmf/test_egrep_cpp.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/mkmf/test_egrep_cpp.rb b/test/mkmf/test_egrep_cpp.rb
index 7ac0e60010..2d10140368 100644
--- a/test/mkmf/test_egrep_cpp.rb
+++ b/test/mkmf/test_egrep_cpp.rb
@@ -10,4 +10,16 @@ class TestMkmfEgrepCpp < TestMkmf
def test_not_have_func
assert_equal(false, egrep_cpp(/never match/, ""), MKMFLOG)
end
+
+ class TestMkmfEgrepCxx < self
+ def test_cxx_egrep_cpp
+ assert_equal(true, MakeMakefile["C++"].egrep_cpp(/^ok/, <<~SRC), MKMFLOG)
+ #ifdef __cplusplus
+ ok
+ #else
+ #error not C++
+ #endif
+ SRC
+ end
+ end
end