<commit_before>-module(trails_SUITE).
-author('<EMAIL>').

-export([all/0]).
-export([init_per_suite/1]).
-export([end_per_suite/1]).

-type config() :: [{atom(), term()}].

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Common test
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

-spec all() -> [atom()].
all() ->
  Exports = ?MODULE:module_info(exports),
  [F || {F, 1} <- Exports, F /= module_info].

-spec init_per_suite(config()) -> config().
init_per_suite(Config) ->
  Config.

-spec end_per_suite(config()) -> config().
end_per_suite(Config) ->
  Config.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Test Cases
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
<commit_msg>[#4] Add trails basic tests to Common Test Suite<commit_after>-module(trails_SUITE).
-author('<EMAIL>').

-export([all/0]).
-export([init_per_suite/1]).
-export([end_per_suite/1]).
-export([basic_compile_test/1]).
-export([minimal_compile_test/1]).
-export([static_compile_test/1]).

-type config() :: [{atom(), term()}].

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Common test
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

-spec all() -> [atom()].
all() ->
  Exports = ?MODULE:module_info(exports),
  [F || {F, 1} <- Exports, F /= module_info].

-spec init_per_suite(config()) -> config().
init_per_suite(Config) ->
  Config.

-spec end_per_suite(config()) -> config().
end_per_suite(Config) ->
  Config.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Test Cases
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

-spec minimal_compile_test(config()) -> config().
minimal_compile_test(Config) ->
  MininalRoute = [{'_',[]}],
  ExpectedResponse = [{'_',[],[]}],
  ExpectedResponse = trails:compile(MininalRoute),
  Config.

-spec basic_compile_test(config()) -> config().
basic_compile_test(Config) ->
  BasicRoute =
    [
      {"localhost",
        [
          {"/such/path", http_such_path_handler, []},
          {"/very", http_very, []},
          {"/", http_handler, []}
       ]}
    ],
  ExpectedResponse =
    [{
      [<<"localhost">>], [],
      [
        {[<<"such">>,<<"path">>], [], http_such_path_handler,[]},
        {[<<"very">>], [], http_very, []},
        {[], [], http_handler, []}
      ]}
    ],
  ExpectedResponse = trails:compile(BasicRoute),
  Config.

-spec static_compile_test(config()) -> config().
static_compile_test(Config) ->
  StaticRoute =
    [
      {'_',
        [
          {"/", cowboy_static, {private_file, something, "index.html"}}
        ]}
    ],
  ExpectedResponse =
    [
      {'_', [],
        [
          {[], [],cowboy_static, {private_file, something, "index.html"}}
        ]}
    ],
  ExpectedResponse = trails:compile(StaticRoute),
  Config.


{'fraction_non_alphanumeric': 0.3891509433962264, 'fraction_numerical': 0.004043126684636119, 'mean_word_length': 4.359205776173285, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 31, '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': '1033658', 'n_tokens_mistral': 919, 'n_tokens_neox': 857, 'n_words': 128}