<commit_before>#include "strstack.h"
#include "test.h"

struct test_strstack_s {
  size_t items;
  const char* seq[10];
};

static const struct test_strstack_s _data[] = {
  { 1, { "test" } },
  { 2, { "one", "two" } },
  { 3, { "", "two", "three" } }
};

TEST( test_strstack_linear, _data, const struct test_strstack_s* data ) {
  strstack_t  stack = STRSTACK_INIT;
  const char* str   = "";
  int i;
  
  for( i = 0; i < data->items; i++ ) {
    ASSERTNE( stack.top, NULL, "before push %i: %s, top: %s", i, data->seq[i], stack.top );
    ASSERTSTREQ( stack.top, str, "str: %s, top: %s", str, stack.top );

    strstack_push( &stack, data->seq[i] );
    ASSERTSTREQ( stack.top, data->seq[i], "after push %i: %s", i, data->seq[i] );
    str = data->seq[i];<commit_msg>Added two more testcases including empty strings.<commit_after>#include "strstack.h"
#include "test.h"

struct test_strstack_s {
  size_t items;
  const char* seq[10];
};

static const struct test_strstack_s _data[] = {
  { 1, { "test" } },
  { 2, { "one", "two" } },
  { 3, { "", "two", "three" } },
  { 3, { "one", "", "three" } },
  { 3, { "one", "two", "" } },
};

TEST( test_strstack_linear, _data, const struct test_strstack_s* data ) {
  strstack_t  stack = STRSTACK_INIT;
  const char* str   = "";
  int i;
  
  for( i = 0; i < data->items; i++ ) {
    ASSERTNE( stack.top, NULL, "before push %i: %s, top: %s", i, data->seq[i], stack.top );
    ASSERTSTREQ( stack.top, str, "str: %s, top: %s", str, stack.top );

    strstack_push( &stack, data->seq[i] );
    ASSERTSTREQ( stack.top, data->seq[i], "after push %i: %s", i, data->seq[i] );
    str = data->seq[i];
{'fraction_non_alphanumeric': 0.20891875381795968, 'fraction_numerical': 0.00855222968845449, 'mean_word_length': 3.403225806451613, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '728802', 'n_tokens_mistral': 676, 'n_tokens_neox': 661, 'n_words': 171}