diff options
author | Björn Gustavsson <[email protected]> | 2018-05-21 07:34:17 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2018-05-21 14:38:20 +0200 |
commit | e1957dd0920276ea942002477a3317cd8d1e7b5e (patch) | |
tree | d1a4d949ab5201d495a356a3a4829d60e3b11ada /lib/compiler | |
parent | 48f2d66707330667c6d3e268466b5440d1b930ab (diff) | |
download | otp-e1957dd0920276ea942002477a3317cd8d1e7b5e.tar.gz otp-e1957dd0920276ea942002477a3317cd8d1e7b5e.tar.bz2 otp-e1957dd0920276ea942002477a3317cd8d1e7b5e.zip |
bs_match_SUITE: Add test of multiple matches
Diffstat (limited to 'lib/compiler')
-rw-r--r-- | lib/compiler/test/bs_match_SUITE.erl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/compiler/test/bs_match_SUITE.erl b/lib/compiler/test/bs_match_SUITE.erl index 235956a714..3b6ffa8d68 100644 --- a/lib/compiler/test/bs_match_SUITE.erl +++ b/lib/compiler/test/bs_match_SUITE.erl @@ -330,6 +330,11 @@ save_restore(Config) when is_list(Config) -> {"-",<<"x">>} = nnn(C), {"-",<<"x">>} = ooo(C), + a = multiple_matches(<<777:16>>, <<777:16>>), + b = multiple_matches(<<777:16>>, <<999:16>>), + c = multiple_matches(<<777:16>>, <<57:8>>), + d = multiple_matches(<<17:8>>, <<1111:16>>), + Bin = <<-1:64>>, case bad_float_unpack_match(Bin) of -1 -> ok; @@ -357,6 +362,11 @@ nnn(<<Char, Tail/binary>>) -> {[Char],Tail}. %% Buggy Tail! ooo(<<" - ", Tail/binary>>) -> Tail; ooo(<<Char, Tail/binary>>) -> {[Char],Tail}. +multiple_matches(<<Y:16>>, <<Y:16>>) -> a; +multiple_matches(<<_:16>>, <<_:16>>) -> b; +multiple_matches(<<_:16>>, <<_:8>>) -> c; +multiple_matches(<<_:8>>, <<_:16>>) -> d. + bad_float_unpack_match(<<F:64/float>>) -> F; bad_float_unpack_match(<<I:64/integer-signed>>) -> I. |