Skip to content

Commit

Permalink
test: Add test for config.pin_last
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberShadow committed Oct 25, 2017
1 parent 0842872 commit 032c8a8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/history-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <assert.h>
#include <glib.h>
#include <history.h>
#include <settings.h>
#include <string.h>

static int test = 0;
Expand Down Expand Up @@ -114,6 +115,17 @@ static void history_test ( void )

g_strfreev ( retv );

// Pinning the last entry
config.pin_last = 1;
for ( unsigned int in = 0; in < 10; in++ ) {
history_set ( file, "popular" );
}
history_set ( file, "last" );

retv = history_get_list ( file, &length );
TASSERT ( g_strcmp0 ( retv[0], "last" ) == 0 );
g_strfreev ( retv );

unlink ( file );
}

Expand Down

0 comments on commit 032c8a8

Please sign in to comment.