|
1 | | -%% ``Licensed under the Apache License, Version 2.0 (the "License"); |
| 1 | +%% |
| 2 | +%% %CopyrightBegin% |
| 3 | +%% |
| 4 | +%% SPDX-License-Identifier: Apache-2.0 |
| 5 | +%% |
| 6 | +%% Copyright Ericsson AB 1996-2025. All Rights Reserved. |
| 7 | +%% |
| 8 | +%% Licensed under the Apache License, Version 2.0 (the "License"); |
2 | 9 | %% you may not use this file except in compliance with the License. |
3 | 10 | %% You may obtain a copy of the License at |
4 | 11 | %% |
|
9 | 16 | %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
10 | 17 | %% See the License for the specific language governing permissions and |
11 | 18 | %% limitations under the License. |
12 | | -%% |
13 | | -%% The Initial Developer of the Original Code is Ericsson Utvecklings AB. |
14 | | -%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings |
15 | | -%% AB. All Rights Reserved.'' |
16 | | -%% |
| 19 | +%% |
| 20 | +%% %CopyrightEnd% |
| 21 | +%% |
17 | 22 | -module(merl_SUITE). |
18 | 23 |
|
19 | 24 | -include_lib("common_test/include/ct.hrl"). |
|
25 | 30 | -include_lib("eunit/include/eunit.hrl"). |
26 | 31 |
|
27 | 32 | %% Test server specific exports |
28 | | --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, |
| 33 | +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, |
29 | 34 | init_per_group/2,end_per_group/2]). |
30 | 35 |
|
31 | 36 | %% Test cases |
32 | 37 | -export([merl_smoke_test/1, |
33 | | - transform_parse_error_test/1, otp_15291/1]). |
| 38 | + transform_parse_error_test/1, otp_15291/1, |
| 39 | + compile_and_load_with_comments/1]). |
34 | 40 |
|
35 | 41 | suite() -> [{ct_hooks,[ts_install_cth]}]. |
36 | 42 |
|
37 | 43 | all() -> |
38 | 44 | [merl_smoke_test, |
39 | 45 | transform_parse_error_test, |
40 | | - otp_15291]. |
| 46 | + otp_15291, |
| 47 | + compile_and_load_with_comments]. |
41 | 48 |
|
42 | 49 | groups() -> |
43 | 50 | []. |
@@ -112,6 +119,18 @@ otp_15291(_Config) -> |
112 | 119 | {clause,A1,[{var,A1,'_'}],[],[{atom,A1,ok}]} = C1, |
113 | 120 | ok. |
114 | 121 |
|
| 122 | +compile_and_load_with_comments(_Config) -> |
| 123 | + ?assertMatch({ok, _}, |
| 124 | + merl:compile_and_load(merl:quote( |
| 125 | + ~"-module(merl_test_module_1)."))), |
| 126 | + ?assertMatch({ok, _}, |
| 127 | + merl:compile_and_load(merl:quote( |
| 128 | + ~"-module(merl_test_module_2). % comment"))), |
| 129 | + ?assertMatch({ok, _}, |
| 130 | + merl:compile_and_load(merl:quote( |
| 131 | + ~"\n-module(merl_test_module_3).\n% comment"))), |
| 132 | + ok. |
| 133 | + |
115 | 134 | %% utilities |
116 | 135 |
|
117 | 136 | f(Ts) when is_list(Ts) -> |
|
0 commit comments