Skip to content
Snippets Groups Projects
Commit 1d326b1b authored by Stefan Wunsch's avatar Stefan Wunsch Committed by Enric Tejedor
Browse files

[PyROOT exp] Add test for string_view backport

parent fee4cfa3
No related branches found
No related tags found
No related merge requests found
...@@ -81,3 +81,6 @@ if(roofit) ...@@ -81,3 +81,6 @@ if(roofit)
# RooDataHist pythonisations # RooDataHist pythonisations
ROOT_ADD_PYUNITTEST(pyroot_pyz_roodatahist_ploton roodatahist_ploton.py) ROOT_ADD_PYUNITTEST(pyroot_pyz_roodatahist_ploton roodatahist_ploton.py)
endif() endif()
# std::string_view backport in CPyCppyy
ROOT_ADD_PYUNITTEST(pyroot_string_view_backport string_view_backport.py)
import unittest
import ROOT
class StringViewBackport(unittest.TestCase):
"""
Test the availability of std::string_view since ROOT has a backport to C++11
"""
def test_interpreter(self):
ROOT.gInterpreter.Declare("std::string TestStringViewBackport(std::string_view x) { return std::string(x); }")
x = ROOT.TestStringViewBackport("foo")
self.assertEqual(str(x), "foo")
def test_rdataframe(self):
df = ROOT.ROOT.RDataFrame("tree", "file.root")
self.assertEqual(str(df), "A data frame built on top of the tree dataset.")
if __name__ == '__main__':
unittest.main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment