lib: deprecate fromHexString on dodgy inputs (#434218)
This commit is contained in:
@@ -392,35 +392,21 @@ runTests {
|
||||
expected = 9223372036854775807;
|
||||
};
|
||||
|
||||
testFromHexStringLeadingZeroes = {
|
||||
expr = fromHexString "00ffffffffffffff";
|
||||
expected = 72057594037927935;
|
||||
};
|
||||
|
||||
testFromHexStringWithPrefix = {
|
||||
expr = fromHexString "0Xf";
|
||||
expr = fromHexString "0xf";
|
||||
expected = 15;
|
||||
};
|
||||
|
||||
# FIXME: This might be bad and should potentially be deprecated.
|
||||
testFromHexStringQuestionableMixedCase = {
|
||||
testFromHexStringMixedCase = {
|
||||
expr = fromHexString "eEeEe";
|
||||
expected = 978670;
|
||||
};
|
||||
|
||||
# FIXME: This is probably bad and should potentially be deprecated.
|
||||
testFromHexStringQuestionableUnderscore = {
|
||||
expr = fromHexString "F_f";
|
||||
expected = 255;
|
||||
};
|
||||
|
||||
# FIXME: This is definitely bad and should be deprecated.
|
||||
testFromHexStringBadComment = {
|
||||
expr = fromHexString "0 # oops";
|
||||
expected = 0;
|
||||
};
|
||||
|
||||
# FIXME: Oh my god.
|
||||
testFromHexStringAwfulInjection = {
|
||||
expr = fromHexString "1\nwhoops = {}";
|
||||
expected = 1;
|
||||
};
|
||||
|
||||
testToBaseDigits = {
|
||||
expr = toBaseDigits 2 6;
|
||||
expected = [
|
||||
|
||||
Reference in New Issue
Block a user