1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
-module(config_encoding_SUITE).
-include("testsuite.hrl").
-compile(export_all).
all() ->
[
bad_encoding,
good_encoding
].
groups() ->
[
].
%%====================================================================
init_per_suite(Config) ->
Config.
end_per_suite(_Config) ->
ok.
init_per_group(_Group, Config) ->
Config.
end_per_group(_Group, _Config) ->
ok.
init_per_testcase(_Test, Config) ->
Config.
end_per_testcase(_Test, _Config) ->
ok.
%%====================================================================
bad_encoding(_Config) ->
Enc = case file:native_name_encoding() of
latin1 -> unicode;
utf8 -> latin1
end,
Env = #env{debug = false,
encoding = Enc,
conf = {file, ?tempdir(?MODULE) ++ "/yaws_unicode.conf"}},
{error, _} = yaws_config:load(Env),
ok.
good_encoding(_Config) ->
Enc = case file:native_name_encoding() of
latin1 -> latin1;
utf8 -> unicode
end,
Env = #env{debug = false,
encoding = Enc,
conf = {file, ?tempdir(?MODULE) ++ "/yaws_unicode.conf"}},
{ok, _, _} = yaws_config:load(Env),
ok.
|