Skip to content

Commit 17b8bc6

Browse files
committed
use regex patterns instead of fixed = TRUE, unsupported by tinytest < 1.3.1
1 parent eff9150 commit 17b8bc6

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎inst/tinytest/test_module.R‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,18 @@ expect_equal( attr_Test_get_x_ref(test), 3.0 )
7676
expect_equal( attr_Test_get_x_pointer(test), 3.0 )
7777

7878
## module object arguments are validated before their address is handed to
79-
## C++, instead of reinterpreting or dereferencing whatever is there (#1523)
79+
## C++, instead of reinterpreting or dereferencing whatever is there (#1523);
80+
## patterns are regular expressions, as tinytest < 1.3.1 has no 'fixed'
8081
expect_error( Test_get_x_const_ref( new( ModuleWorld ) ),
81-
"Expecting an object of C++ class 'ModuleTest', got an object of class 'ModuleWorld'",
82-
fixed = TRUE )
82+
"Expecting an object of C\\+\\+ class 'ModuleTest', got an object of class 'ModuleWorld'" )
8383
expect_error( attr_Test_get_x_ref( new( ModuleWorld ) ),
84-
"got an object of class 'ModuleWorld'", fixed = TRUE )
84+
"got an object of class 'ModuleWorld'" )
8585
expect_error( Test_get_x_pointer( unserialize( serialize( test, NULL ) ) ),
8686
"external pointer is not valid" )
8787
uninitialized <- new( ModuleTest )
8888
expect_error( Test_get_x_ref( uninitialized ), "not initialized" )
8989
expect_error( Test_get_x_const_pointer( 1 ),
90-
"Expecting an object of C++ class 'ModuleTest'", fixed = TRUE )
90+
"Expecting an object of C\\+\\+ class 'ModuleTest'" )
9191

9292
## objects of a class that derives() from the expected one are accepted
9393
expect_equal( ModuleBase_value( new( ModuleBase ) ), 1.0 )

0 commit comments

Comments
 (0)