Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:17:43

0001 
0002 // Copyright 2022, Jefferson Science Associates, LLC.
0003 // Subject to the terms in the LICENSE file found in the top-level directory.
0004 
0005 #include "catch.hpp"
0006 #include <JANA/Utils/JAutoActivator.h>
0007 
0008 TEST_CASE("String splitting") {
0009     auto pair = JAutoActivator::Split("all_just_objname");
0010     REQUIRE(pair.first == "all_just_objname");
0011     REQUIRE(pair.second == "");
0012 
0013     pair = JAutoActivator::Split("objname:tag");
0014     REQUIRE(pair.first == "objname");
0015     REQUIRE(pair.second == "tag");
0016 
0017     pair = JAutoActivator::Split("name::type:factag");
0018     REQUIRE(pair.first == "name::type");
0019     REQUIRE(pair.second == "factag");
0020 
0021     pair = JAutoActivator::Split("name::type");
0022     REQUIRE(pair.first == "name::type");
0023     REQUIRE(pair.second == "");
0024 
0025     pair = JAutoActivator::Split("name::type:tag:more_tag");
0026     REQUIRE(pair.first == "name::type");
0027     REQUIRE(pair.second == "tag:more_tag");
0028 
0029     pair = JAutoActivator::Split("name::type:tag:more_tag::most_tag");
0030     REQUIRE(pair.first == "name::type");
0031     REQUIRE(pair.second == "tag:more_tag::most_tag");
0032 
0033     pair = JAutoActivator::Split("::name::type:tag:more_tag::most_tag");
0034     REQUIRE(pair.first == "::name::type");
0035     REQUIRE(pair.second == "tag:more_tag::most_tag");
0036 
0037     pair = JAutoActivator::Split(":I_guess_this_should_be_a_tag_idk");
0038     REQUIRE(pair.first == "");
0039     REQUIRE(pair.second == "I_guess_this_should_be_a_tag_idk");
0040 }