aboutsummaryrefslogtreecommitdiffstats
path: root/lib/debugger/test/bs_match_misc_SUITE.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/debugger/test/bs_match_misc_SUITE.erl')
-rw-r--r--lib/debugger/test/bs_match_misc_SUITE.erl11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/debugger/test/bs_match_misc_SUITE.erl b/lib/debugger/test/bs_match_misc_SUITE.erl
index 6b66c45448..54fa9a59df 100644
--- a/lib/debugger/test/bs_match_misc_SUITE.erl
+++ b/lib/debugger/test/bs_match_misc_SUITE.erl
@@ -26,7 +26,7 @@
kenneth/1,encode_binary/1,native/1,happi/1,
size_var/1,wiger/1,x0_context/1,huge_float_field/1,
writable_binary_matched/1,otp_7198/1,
- unordered_bindings/1]).
+ unordered_bindings/1,float_middle_endian/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -36,7 +36,7 @@ all() ->
[bound_var, bound_tail, t_float, little_float, sean,
kenneth, encode_binary, native, happi, size_var, wiger,
x0_context, huge_float_field, writable_binary_matched,
- otp_7198, unordered_bindings].
+ otp_7198, unordered_bindings, float_middle_endian].
groups() ->
[].
@@ -106,6 +106,13 @@ t_float(Config) when is_list(Config) ->
ok.
+float_middle_endian(Config) when is_list(Config) ->
+ F = 9007199254740990.0, % turns to -NaN when word-swapped
+ ?line fcmp(F, match_float(<<F:64/float>>, 64, 0)),
+ ?line fcmp(F, match_float(<<1:1,F:64/float,127:7>>, 64, 1)),
+ ?line fcmp(F, match_float(<<1:13,F:64/float,127:3>>, 64, 13)),
+ ok.
+
fcmp(F1, F2) when (F1 - F2) / F2 < 0.0000001 -> ok.