Sha256: 8d459bc44330038ba38ae60fe10d9727f452b9783ea5edd6059afedbbf2e5c24

Contents?: true

Size: 1.69 KB

Versions: 17

Compression:

Stored size: 1.69 KB

Contents

#include "clar.h"
#include "clar_test.h"
#include "deps/trim/trim.h"
#include <stdio.h>
#include <string.h>

static char *fixture_tex;
static char *fixture_mml;
static char *result;

void test_symbols__initialize(void)
{
  global_test_counter++;
}

void test_symbols__cleanup(void)
{
  if (fixture_mml != NULL) {
    free(fixture_mml);
  }

  if (result != NULL) {
    free(result);
  }
}

void test_symbols__textgreater(void)
{
  fixture_tex = read_fixture_tex("symbols/textgreater.txt");
  fixture_mml = read_fixture_mml("symbols/textgreater.html");
  mtex2MML_text_filter(fixture_tex, strlen(fixture_tex), MTEX2MML_DELIMITER_DOLLAR);
  result = mtex2MML_output();

  cl_assert_equal_s(fixture_mml, trim(result));
  free(fixture_tex);
}

void test_symbols__textless(void)
{
  fixture_tex = read_fixture_tex("symbols/textless.txt");
  fixture_mml = read_fixture_mml("symbols/textless.html");
  mtex2MML_text_filter(fixture_tex, strlen(fixture_tex), MTEX2MML_DELIMITER_DOLLAR);
  result = mtex2MML_output();

  cl_assert_equal_s(fixture_mml, trim(result));
  free(fixture_tex);
}

void test_symbols__gt(void)
{
  fixture_tex = read_fixture_tex("symbols/gt.txt");
  fixture_mml = read_fixture_mml("symbols/gt.html");
  mtex2MML_text_filter(fixture_tex, strlen(fixture_tex), MTEX2MML_DELIMITER_DOLLAR);
  result = mtex2MML_output();

  cl_assert_equal_s(fixture_mml, trim(result));
  free(fixture_tex);
}

void test_symbols__lt(void)
{
  fixture_tex = read_fixture_tex("symbols/lt.txt");
  fixture_mml = read_fixture_mml("symbols/lt.html");
  mtex2MML_text_filter(fixture_tex, strlen(fixture_tex), MTEX2MML_DELIMITER_DOLLAR);
  result = mtex2MML_output();

  cl_assert_equal_s(fixture_mml, trim(result));
  free(fixture_tex);
}

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
mathematical-1.6.20 ext/mathematical/mtex2MML/tests/symbols.c
mathematical-1.6.18 ext/mathematical/mtex2MML/tests/symbols.c
mathematical-1.6.14 ext/mathematical/mtex2MML/tests/symbols.c
mathematical-1.6.13 ext/mathematical/mtex2MML/tests/symbols.c
mathematical-1.6.12 ext/mathematical/mtex2MML/tests/symbols.c
mathematical-1.6.11 ext/mathematical/mtex2MML/tests/symbols.c
mathematical-1.6.10 ext/mathematical/mtex2MML/tests/symbols.c
mathematical-1.6.9 ext/mathematical/mtex2MML/tests/symbols.c
mathematical-1.6.8 ext/mathematical/mtex2MML/tests/symbols.c
mathematical-1.6.7 ext/mathematical/mtex2MML/tests/symbols.c
mathematical-1.6.6 ext/mathematical/mtex2MML/tests/symbols.c
mathematical-1.6.5 ext/mathematical/mtex2MML/tests/symbols.c
mathematical-1.6.4 ext/mathematical/mtex2MML/tests/symbols.c
mathematical-1.6.3 ext/mathematical/mtex2MML/tests/symbols.c
mathematical-1.6.2 ext/mathematical/mtex2MML/tests/symbols.c
mathematical-1.6.1 ext/mathematical/mtex2MML/tests/symbols.c
mathematical-1.6.0 ext/mathematical/mtex2MML/tests/symbols.c