MCPcopy Create free account
hub / github.com/RaftLib/RaftLib / main

Function main

testsuite/fixedMatchTest.cpp:8–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#include <iostream>
7
8int
9main()
10{
11 using chunk = raft::filechunk< 512>;
12 using fr = raft::filereader< chunk, false >;
13 using search = raft::search< chunk, raft::stdlib >;
14 std::vector< raft::match_t > matches;
15
16
17 const std::string term( "Alice" );
18 raft::map m;
19 fr read( "./alice.txt" /** ex file **/,
20 (fr::offset_type) term.length(),
21 1 );
22
23 search find( term );
24 auto we( raft::write_each< raft::match_t >(
25 std::back_inserter( matches ) ) );
26 m += read >> find >> we;
27 /** m.exe() is an implicit barrier for completion of execution **/
28 m.exe();
29 if( matches.size() != 174 /** count from grep **/ )
30 {
31 return( EXIT_FAILURE );
32 }
33 std::cout << matches.size() << "\n";
34 return( EXIT_SUCCESS );
35}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected