libept
action.test.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 #include <ept/core/apt/action.h>
3 #include <ept/test.h>
4 
5 using namespace ept::core;
6 
8 {
10  TestAptAction() : pkgs( db ) {}
11 
12  Test basic() {
13  ept::Token t( "sp" );
15  a.apply( pkgs );
16  assert( pkgs.get< package::State >( t ).install() );
18  a.apply( pkgs );
19  assert( pkgs.get< package::State >( t ).keep() );
20  }
21 
22  Test revert() {
23  ept::Token t( "sp" );
25  a.apply( pkgs );
26  assert( pkgs.get< package::State >( t ).install() );
27  pkgs.revertStates();
28  assert( pkgs.get< package::State >( t ).keep() );
29  }
30 
31  Test keep() {
33  ept::Token t( "sp" );
35  assert( !al.empty() );
38  al.replay( pkgs );
39  assert( pkgs.get< package::State >( t ).keep() );
40  }
41 };