1%%
2%% %CopyrightBegin%
3%%
4%% Copyright Ericsson AB 2005-2018. All Rights Reserved.
5%%
6%% Licensed under the Apache License, Version 2.0 (the "License");
7%% you may not use this file except in compliance with the License.
8%% You may obtain a copy of the License at
9%%
10%%     http://www.apache.org/licenses/LICENSE-2.0
11%%
12%% Unless required by applicable law or agreed to in writing, software
13%% distributed under the License is distributed on an "AS IS" BASIS,
14%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15%% See the License for the specific language governing permissions and
16%% limitations under the License.
17%%
18%% %CopyrightEnd%
19%%
20-module(opt_crash).
21-export([?MODULE/0,test/0]).
22
23?MODULE() ->
24    ok.
25
26test() ->
27   URI_Before =
28   {absoluteURI,
29      {scheme,fun() -> nil end},
30      {'hier-part',
31         {'net-path',
32            {srvr,
33               {userinfo,nil},
34               fun() -> nil end},
35            nil},
36         {query,nil}}},
37
38   {absoluteURI,
39      {scheme,_},
40      {'hier-part',
41         {'net-path',
42            {srvr,
43               {userinfo,nil},
44               HostportBefore},
45            nil},
46         {query,nil}}} = URI_Before,
47
48   %% ... some funky code ommitted, not relevant ...
49
50   {absoluteURI,
51      {scheme,_},
52      {'hier-part',
53         {'net-path',
54            {srvr,
55               {userinfo,nil},
56               HostportAfter},
57            nil},
58         {query,nil}}} = URI_Before,
59   %% NOTE: I intended to write URI_After instead of URI_Before
60   %% but the accident revealed that when you add the line below,
61   %% it causes internal error in v3_codegen on compilation
62   {hostport,{hostname,"HostName"},{port,nil}} = HostportAfter,
63
64   ok.
65
66
67