diff --git a/foundry.toml b/foundry.toml index a3eae5b8..b59d8736 100644 --- a/foundry.toml +++ b/foundry.toml @@ -37,6 +37,7 @@ remappings = [ "rain.sol.codegen/=lib/rain.sol.codegen/src/", "rain.solmem/=lib/rain.interpreter.interface/lib/rain.solmem/src/", "openzeppelin-contracts/=lib/rain.interpreter.interface/lib/openzeppelin-contracts/", + "rain.math.float/=lib/rain.math.float/src/", ] [fuzz] diff --git a/src/concrete/extern/RainterpreterReferenceExternNPE2.sol b/src/concrete/extern/RainterpreterReferenceExternNPE2.sol index b617fd80..54a62053 100644 --- a/src/concrete/extern/RainterpreterReferenceExternNPE2.sol +++ b/src/concrete/extern/RainterpreterReferenceExternNPE2.sol @@ -34,7 +34,7 @@ import { INTEGRITY_FUNCTION_POINTERS, OPCODE_FUNCTION_POINTERS } from "../../generated/RainterpreterReferenceExternNPE2.pointers.sol"; -import {LibDecimalFloat} from "rain.math.float/src/lib/LibDecimalFloat.sol"; +import {LibDecimalFloat} from "rain.math.float/lib/LibDecimalFloat.sol"; /// @dev The number of subparser functions available to the parser. This is NOT /// 1:1 with the number of opcodes provided by the extern component of this diff --git a/src/lib/extern/reference/op/LibExternOpIntIncNPE2.sol b/src/lib/extern/reference/op/LibExternOpIntIncNPE2.sol index 043455fc..ea31c2f8 100644 --- a/src/lib/extern/reference/op/LibExternOpIntIncNPE2.sol +++ b/src/lib/extern/reference/op/LibExternOpIntIncNPE2.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.25; import {Operand} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; import {LibSubParse} from "../../../parse/LibSubParse.sol"; import {IInterpreterExternV3} from "rain.interpreter.interface/interface/IInterpreterExternV3.sol"; -import {LibDecimalFloat} from "rain.math.float/src/lib/LibDecimalFloat.sol"; +import {LibDecimalFloat} from "rain.math.float/lib/LibDecimalFloat.sol"; /// @dev Opcode index of the extern increment opcode. Needs to be manually kept /// in sync with the extern opcode function pointers. Definitely write tests for diff --git a/src/lib/parse/LibParseOperand.sol b/src/lib/parse/LibParseOperand.sol index 161aa304..be2dfb56 100644 --- a/src/lib/parse/LibParseOperand.sol +++ b/src/lib/parse/LibParseOperand.sol @@ -16,7 +16,7 @@ import {CMASK_OPERAND_END, CMASK_WHITESPACE, CMASK_OPERAND_START} from "./LibPar import {ParseState, OPERAND_VALUES_LENGTH, FSM_YANG_MASK} from "./LibParseState.sol"; import {LibParseError} from "./LibParseError.sol"; import {LibParseInterstitial} from "./LibParseInterstitial.sol"; -import {LibDecimalFloat} from "rain.math.float/src/lib/LibDecimalFloat.sol"; +import {LibDecimalFloat} from "rain.math.float/lib/LibDecimalFloat.sol"; library LibParseOperand { using LibParseError for ParseState; diff --git a/src/lib/parse/literal/LibParseLiteralDecimal.sol b/src/lib/parse/literal/LibParseLiteralDecimal.sol index 21baed77..426e2e57 100644 --- a/src/lib/parse/literal/LibParseLiteralDecimal.sol +++ b/src/lib/parse/literal/LibParseLiteralDecimal.sol @@ -18,7 +18,7 @@ import { } from "../LibParseCMask.sol"; import {LibParseError} from "../LibParseError.sol"; import {LibParse} from "../LibParse.sol"; -import {LibDecimalFloatImplementation, LibDecimalFloat} from "rain.math.float/src/lib/LibDecimalFloat.sol"; +import {LibDecimalFloatImplementation, LibDecimalFloat} from "rain.math.float/lib/LibDecimalFloat.sol"; /// @dev The default is 18 decimal places for a fractional number. uint256 constant DECIMAL_SCALE = 18; diff --git a/test/src/concrete/RainterpreterNPE2.stateOverlay.t.sol b/test/src/concrete/RainterpreterNPE2.stateOverlay.t.sol index 348f55cd..c95cce6e 100644 --- a/test/src/concrete/RainterpreterNPE2.stateOverlay.t.sol +++ b/test/src/concrete/RainterpreterNPE2.stateOverlay.t.sol @@ -6,7 +6,7 @@ import {RainterpreterExpressionDeployerNPE2DeploymentTest} from import {FullyQualifiedNamespace, StateNamespace} from "rain.interpreter.interface/interface/IInterpreterStoreV2.sol"; import {EvalV4, SourceIndexV2} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; import {LibNamespace} from "rain.interpreter.interface/lib/ns/LibNamespace.sol"; -import {LibDecimalFloat} from "rain.math.float/src/lib/LibDecimalFloat.sol"; +import {LibDecimalFloat} from "rain.math.float/lib/LibDecimalFloat.sol"; contract RainterpreterNPE2StateOverlayTest is RainterpreterExpressionDeployerNPE2DeploymentTest { /// Show that state overlay can prewarm a get. diff --git a/test/src/concrete/RainterpreterReferenceExternNPE2.intInc.t.sol b/test/src/concrete/RainterpreterReferenceExternNPE2.intInc.t.sol index 88fd7ebf..7f67ea84 100644 --- a/test/src/concrete/RainterpreterReferenceExternNPE2.intInc.t.sol +++ b/test/src/concrete/RainterpreterReferenceExternNPE2.intInc.t.sol @@ -19,7 +19,7 @@ import {LibExtern} from "src/lib/extern/LibExtern.sol"; import {Strings} from "openzeppelin-contracts/contracts/utils/Strings.sol"; import {OPCODE_EXTERN} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; import {ExternDispatchConstantsHeightOverflow} from "src/error/ErrSubParse.sol"; -import {LibDecimalFloat} from "rain.math.float/src/lib/LibDecimalFloat.sol"; +import {LibDecimalFloat} from "rain.math.float/lib/LibDecimalFloat.sol"; import {CURRENT_COMPATIBILITY} from "src/lib/parse/LibSubParse.sol"; contract RainterpreterReferenceExternNPE2IntIncTest is OpTest { @@ -70,6 +70,7 @@ contract RainterpreterReferenceExternNPE2IntIncTest is OpTest { } /// Directly test the subparsing of the reference extern opcode. + /// forge-config: default.fuzz.runs = 100 function testRainterpreterReferenceExternNPE2IntIncSubParseKnownWord(uint16 constantsHeight, bytes1 ioByte) external { @@ -107,6 +108,7 @@ contract RainterpreterReferenceExternNPE2IntIncTest is OpTest { /// Directly test the subparsing of the reference extern opcode. Check that /// we get a false for success if the subparser doesn't recognize the word /// but the data is otherwise valid. + /// forge-config: default.fuzz.runs = 100 function testRainterpreterReferenceExternNPE2IntIncSubParseUnknownWord( uint16 constantsHeight, bytes1 ioByte, @@ -129,6 +131,7 @@ contract RainterpreterReferenceExternNPE2IntIncTest is OpTest { /// Test the inc library directly. The run function should increment every /// value it is passed by 1. + /// forge-config: default.fuzz.runs = 100 function testRainterpreterReferenceExternNPE2IntIncRun(Operand operand, uint256[] memory inputs) external pure { uint256[] memory expectedOutputs = new uint256[](inputs.length); for (uint256 i = 0; i < inputs.length; i++) { @@ -147,6 +150,7 @@ contract RainterpreterReferenceExternNPE2IntIncTest is OpTest { /// Test the inc library directly. The integrity function should return the /// same inputs and outputs. + /// forge-config: default.fuzz.runs = 100 function testRainterpreterReferenceExternNPE2IntIncIntegrity(Operand operand, uint256 inputs, uint256 outputs) external pure diff --git a/test/src/concrete/RainterpreterStoreNPE2.t.sol b/test/src/concrete/RainterpreterStoreNPE2.t.sol index 69be0e29..fb41814d 100644 --- a/test/src/concrete/RainterpreterStoreNPE2.t.sol +++ b/test/src/concrete/RainterpreterStoreNPE2.t.sol @@ -35,6 +35,7 @@ contract RainterpreterStoreNPE2Test is Test { /// Ensure the store gives a decent error message when an odd number of /// arguments is passed to `set`. + /// forge-config: default.fuzz.runs = 100 function testRainterpreterStoreNPE2SetOddLength(StateNamespace namespace, uint256[] memory kvs) external { vm.assume(kvs.length % 2 != 0); @@ -45,6 +46,7 @@ contract RainterpreterStoreNPE2Test is Test { /// Store should set and get values correctly. /// This test assumes no dupes. + /// forge-config: default.fuzz.runs = 100 function testRainterpreterStoreNPE2SetGetNoDupesSingle(StateNamespace namespace, uint256[] memory kvs) external { // Truncate to even length. uint256 newLength = kvs.length - (kvs.length % 2); @@ -71,7 +73,8 @@ contract RainterpreterStoreNPE2Test is Test { uint256[] kvs; } - /// Store should get and set values correctly across many namespaces. + /// Store should get and set values correctly across many namespaces.j + /// forge-config: default.fuzz.runs = 100 function testRainterpreterStoreNPE2SetGetNoDupesMany(Set[] memory sets) external { uint256 setsLength = sets.length >= 10 ? 10 : sets.length; uint256[] memory refs; @@ -115,7 +118,7 @@ contract RainterpreterStoreNPE2Test is Test { /// previous writes to the same key (i.e. like a k/v store). The assumption /// is that the fuzzer will generate some dupes just randomly, so there's /// no special logic to make that happen. - + /// forge-config: default.fuzz.runs = 100 function testRainterpreterStoreNPE2SetGetDupes(Set11[] memory sets) external { vm.assume(sets.length < 20); diff --git a/test/src/lib/op/00/LibOpConstantNP.t.sol b/test/src/lib/op/00/LibOpConstantNP.t.sol index 9ca735cf..8c080b71 100644 --- a/test/src/lib/op/00/LibOpConstantNP.t.sol +++ b/test/src/lib/op/00/LibOpConstantNP.t.sol @@ -18,7 +18,7 @@ import {IInterpreterStoreV2} from "rain.interpreter.interface/interface/IInterpr import {SignedContextV1} from "rain.interpreter.interface/interface/IInterpreterCallerV3.sol"; import {LibOperand} from "test/lib/operand/LibOperand.sol"; import {BadOpOutputsLength} from "src/error/ErrIntegrity.sol"; -import {LibDecimalFloat} from "rain.math.float/src/lib/LibDecimalFloat.sol"; +import {LibDecimalFloat} from "rain.math.float/lib/LibDecimalFloat.sol"; /// @title LibOpConstantNPTest /// @notice Test the runtime and integrity time logic of LibOpConstantNP. diff --git a/test/src/lib/op/00/LibOpContextNP.t.sol b/test/src/lib/op/00/LibOpContextNP.t.sol index 2c22e3f7..c1c38bfa 100644 --- a/test/src/lib/op/00/LibOpContextNP.t.sol +++ b/test/src/lib/op/00/LibOpContextNP.t.sol @@ -34,6 +34,7 @@ contract LibOpContextNPTest is OpTest { /// Directly test the runtime logic of LibOpContextNP. This tests that the /// values in the context matrix can be pushed to the stack via. the operand. + /// forge-config: default.fuzz.runs = 100 function testOpContextNPRun(uint256[][] memory context, uint256 i, uint256 j) external view { InterpreterStateNP memory state = opTestDefaultInterpreterState(); state.context = context; @@ -52,6 +53,7 @@ contract LibOpContextNPTest is OpTest { /// Directly test the reference logic of LibOpContextNP. This tests that the /// runtime logic will revert if the indexes are OOB. Tests that i is OOB. + /// forge-config: default.fuzz.runs = 100 function testOpContextNPRunOOBi(uint256[][] memory context, uint256 i, uint256 j) external { InterpreterStateNP memory state = opTestDefaultInterpreterState(); state.context = context; @@ -68,6 +70,7 @@ contract LibOpContextNPTest is OpTest { /// Directly test the reference logic of LibOpContextNP. This tests that the /// runtime logic will revert if the indexes are OOB. Tests that j is OOB. + /// forge-config: default.fuzz.runs = 100 function testOpContextNPRunOOBj(uint256[][] memory context, uint256 i, uint256 j) external { InterpreterStateNP memory state = opTestDefaultInterpreterState(); state.context = context; @@ -85,6 +88,7 @@ contract LibOpContextNPTest is OpTest { } /// Test the eval of context opcode parsed from a string. This tests 0 0. + /// forge-config: default.fuzz.runs = 100 function testOpContextNPEval00(uint256[][] memory context) external view { vm.assume(context.length > 0); vm.assume(context[0].length > 0); @@ -108,6 +112,7 @@ contract LibOpContextNPTest is OpTest { } /// Test the eval of context opcode parsed from a string. This tests 0 1. + /// forge-config: default.fuzz.runs = 100 function testOpContextNPEval01(uint256[][] memory context) external view { vm.assume(context.length > 0); vm.assume(context[0].length > 1); @@ -130,6 +135,7 @@ contract LibOpContextNPTest is OpTest { } /// Test the eval of context opcode parsed from a string. This tests 1 0. + /// forge-config: default.fuzz.runs = 100 function testOpContextNPEval10(uint256[][] memory context) external view { vm.assume(context.length > 1); vm.assume(context[1].length > 0); @@ -153,6 +159,7 @@ contract LibOpContextNPTest is OpTest { } /// Test the eval of context opcode parsed from a string. This tests 1 1. + /// forge-config: default.fuzz.runs = 100 function testOpContextNPEval11(uint256[][] memory context) external view { vm.assume(context.length > 1); vm.assume(context[1].length > 1); @@ -176,6 +183,7 @@ contract LibOpContextNPTest is OpTest { } /// Test the eval of context opcode parsed from a string. This tests OOB i. + /// forge-config: default.fuzz.runs = 100 function testOpContextNPEvalOOBi(uint256[] memory context0) external { uint256[][] memory context = new uint256[][](1); context[0] = context0; diff --git a/test/src/lib/op/00/LibOpExternNP.t.sol b/test/src/lib/op/00/LibOpExternNP.t.sol index 6bbe475b..82f8a303 100644 --- a/test/src/lib/op/00/LibOpExternNP.t.sol +++ b/test/src/lib/op/00/LibOpExternNP.t.sol @@ -17,7 +17,7 @@ import { import {IERC165} from "openzeppelin-contracts/contracts/utils/introspection/IERC165.sol"; import {LibOperand} from "test/lib/operand/LibOperand.sol"; import {LibUint256Array} from "rain.solmem/lib/LibUint256Array.sol"; -import {LibDecimalFloat} from "rain.math.float/src/lib/LibDecimalFloat.sol"; +import {LibDecimalFloat} from "rain.math.float/lib/LibDecimalFloat.sol"; /// @title LibOpExternNPTest /// @notice Test the runtime and integrity time logic of LibOpExternNP. diff --git a/test/src/lib/op/00/LibOpStackNP.t.sol b/test/src/lib/op/00/LibOpStackNP.t.sol index 077cf7d1..7e4814cf 100644 --- a/test/src/lib/op/00/LibOpStackNP.t.sol +++ b/test/src/lib/op/00/LibOpStackNP.t.sol @@ -21,7 +21,7 @@ import {OpTest, PRE, POST} from "test/abstract/OpTest.sol"; import {SignedContextV1} from "rain.interpreter.interface/interface/IInterpreterCallerV3.sol"; import {LibOperand} from "test/lib/operand/LibOperand.sol"; import {BadOpOutputsLength} from "src/error/ErrIntegrity.sol"; -import {LibDecimalFloat} from "rain.math.float/src/lib/LibDecimalFloat.sol"; +import {LibDecimalFloat} from "rain.math.float/lib/LibDecimalFloat.sol"; /// @title LibOpStackNPTest /// @notice Test the runtime and integrity time logic of LibOpStackNP. @@ -69,6 +69,7 @@ contract LibOpStackNPTest is OpTest { /// Directly test the runtime logic of LibOpStackNP. This tests that the /// operand always puts a single value on the stack. + /// forge-config: default.fuzz.runs = 100 function testOpStackNPRun(uint256[][] memory stacks, uint256 stackIndex) external view { InterpreterStateNP memory state = opTestDefaultInterpreterState(); uint256 stackValue; diff --git a/test/src/lib/op/bitwise/LibOpShiftBitsRightNP.t.sol b/test/src/lib/op/bitwise/LibOpShiftBitsRightNP.t.sol index d4d9353d..75c27964 100644 --- a/test/src/lib/op/bitwise/LibOpShiftBitsRightNP.t.sol +++ b/test/src/lib/op/bitwise/LibOpShiftBitsRightNP.t.sol @@ -22,6 +22,7 @@ contract LibOpShiftBitsRightNPTest is OpTest { /// Directly test the integrity logic of LibOpShiftBitsRightNP. Tests the /// happy path where the integrity check does not error due to an unsupported /// shift amount. + /// forge-config: default.fuzz.runs = 100 function testOpShiftBitsRightNPIntegrityHappy( IntegrityCheckStateNP memory state, uint8 inputs, @@ -40,6 +41,7 @@ contract LibOpShiftBitsRightNPTest is OpTest { /// Directly test the execution logic of LibOpShiftBitsRightNP. Tests that /// any shift amount that always results in an output of 0 will error as /// an unsupported shift amount. + /// forge-config: default.fuzz.runs = 100 function testOpShiftBitsRightNPIntegrityZero(IntegrityCheckStateNP memory state, uint8 inputs, uint16 shiftAmount16) external { @@ -53,6 +55,7 @@ contract LibOpShiftBitsRightNPTest is OpTest { /// Directly test the execution logic of LibOpShiftBitsRightNP. Tests that /// any shift amount that is a noop (0) will error as an unsupported shift /// amount. + /// forge-config: default.fuzz.runs = 100 function testOpShiftBitsRightNPIntegrityNoop(IntegrityCheckStateNP memory state, uint8 inputs) external { Operand operand = Operand.wrap(uint256(inputs) << 0x10); vm.expectRevert(abi.encodeWithSelector(UnsupportedBitwiseShiftAmount.selector, 0)); diff --git a/test/src/lib/op/call/LibOpCallNP.t.sol b/test/src/lib/op/call/LibOpCallNP.t.sol index 144936ac..40b56037 100644 --- a/test/src/lib/op/call/LibOpCallNP.t.sol +++ b/test/src/lib/op/call/LibOpCallNP.t.sol @@ -17,7 +17,7 @@ import {LibBytecode, SourceIndexOutOfBounds} from "rain.interpreter.interface/li import {BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; import {STACK_TRACER} from "src/lib/state/LibInterpreterStateNP.sol"; import {LibOperand} from "test/lib/operand/LibOperand.sol"; -import {LibDecimalFloat} from "rain.math.float/src/lib/LibDecimalFloat.sol"; +import {LibDecimalFloat} from "rain.math.float/lib/LibDecimalFloat.sol"; /// @title LibOpCallNPTest /// @notice Test the LibOpCallNP library that includes the "call" word. diff --git a/test/src/lib/op/crypto/LibOpHashNP.t.sol b/test/src/lib/op/crypto/LibOpHashNP.t.sol index 304eb0c2..782b6696 100644 --- a/test/src/lib/op/crypto/LibOpHashNP.t.sol +++ b/test/src/lib/op/crypto/LibOpHashNP.t.sol @@ -23,7 +23,7 @@ import {SignedContextV1} from "rain.interpreter.interface/interface/IInterpreter import {LibIntegrityCheckNP, IntegrityCheckStateNP} from "src/lib/integrity/LibIntegrityCheckNP.sol"; import {InterpreterStateNP, LibInterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.sol"; import {LibOperand} from "test/lib/operand/LibOperand.sol"; -import {LibDecimalFloat} from "rain.math.float/src/lib/LibDecimalFloat.sol"; +import {LibDecimalFloat} from "rain.math.float/lib/LibDecimalFloat.sol"; /// @title LibOpHashNPTest /// @notice Test the runtime and integrity time logic of LibOpHashNP. diff --git a/test/src/lib/parse/LibParse.literalIntegerDecimal.t.sol b/test/src/lib/parse/LibParse.literalIntegerDecimal.t.sol index 23ca2183..767569ea 100644 --- a/test/src/lib/parse/LibParse.literalIntegerDecimal.t.sol +++ b/test/src/lib/parse/LibParse.literalIntegerDecimal.t.sol @@ -8,7 +8,7 @@ import {DecimalLiteralOverflow} from "src/lib/parse/literal/LibParseLiteral.sol" import {LibParse, UnexpectedRHSChar, UnexpectedRightParen} from "src/lib/parse/LibParse.sol"; import {LibBytecode} from "rain.interpreter.interface/lib/bytecode/LibBytecode.sol"; import {ParseState} from "src/lib/parse/LibParseState.sol"; -import {LibDecimalFloat} from "rain.math.float/src/lib/LibDecimalFloat.sol"; +import {LibDecimalFloat} from "rain.math.float/lib/LibDecimalFloat.sol"; /// @title LibParseLiteralIntegerDecimalTest /// Tests parsing integer literal decimal values. diff --git a/test/src/lib/parse/LibParse.literalString.t.sol b/test/src/lib/parse/LibParse.literalString.t.sol index e25fde6c..acf1fc32 100644 --- a/test/src/lib/parse/LibParse.literalString.t.sol +++ b/test/src/lib/parse/LibParse.literalString.t.sol @@ -55,6 +55,7 @@ contract LibParseLiteralStringTest is Test { /// Any ASCII printable string shorter than 32 bytes should be parsed /// correctly. + /// forge-config: default.fuzz.runs = 100 function testParseStringLiteralShortASCII(string memory str) external view { vm.assume(bytes(str).length < 0x20); LibLiteralString.conformValidPrintableStringContent(str); @@ -75,6 +76,7 @@ contract LibParseLiteralStringTest is Test { } /// Can parse 2 valid strings. + /// forge-config: default.fuzz.runs = 100 function testParseStringLiteralTwo(string memory strA, string memory strB) external view { vm.assume(bytes(strA).length < 0x20); LibLiteralString.conformValidPrintableStringContent(strA); @@ -99,6 +101,7 @@ contract LibParseLiteralStringTest is Test { } /// Valid ASCII printable strings 32 bytes or longer should error. + /// forge-config: default.fuzz.runs = 100 function testParseStringLiteralLongASCII(string memory str) external { vm.assume(bytes(str).length >= 0x20); LibLiteralString.conformValidPrintableStringContent(str); @@ -110,6 +113,7 @@ contract LibParseLiteralStringTest is Test { /// Invalid chars beyond the 31 byte valid range will not be parsed. Instead /// a `StringTooLong` error will be thrown. + /// forge-config: default.fuzz.runs = 100 function testParseStringLiteralInvalidCharAfter(string memory strA, string memory strB) external { vm.assume(bytes(strA).length >= 0x20); LibLiteralString.conformValidPrintableStringContent(strA); @@ -126,6 +130,7 @@ contract LibParseLiteralStringTest is Test { /// Invalid chars anywhere in the parsed string will cause an unclosed /// string literal error. + /// forge-config: default.fuzz.runs = 100 function testParseStringLiteralInvalidCharWithin(string memory str, uint256 badIndex) external { vm.assume(bytes(str).length > 0); LibLiteralString.conformValidPrintableStringContent(str); diff --git a/test/src/lib/parse/LibParse.namedLHS.t.sol b/test/src/lib/parse/LibParse.namedLHS.t.sol index 315c8007..d3e5a416 100644 --- a/test/src/lib/parse/LibParse.namedLHS.t.sol +++ b/test/src/lib/parse/LibParse.namedLHS.t.sol @@ -15,7 +15,7 @@ import {Operand, LibParseOperand} from "src/lib/parse/LibParseOperand.sol"; import {LibConvert} from "rain.lib.typecast/LibConvert.sol"; import {LibAllStandardOpsNP} from "src/lib/op/LibAllStandardOpsNP.sol"; import {LibGenParseMeta} from "rain.sol.codegen/lib/LibGenParseMeta.sol"; -import {LibDecimalFloat} from "rain.math.float/src/lib/LibDecimalFloat.sol"; +import {LibDecimalFloat} from "rain.math.float/lib/LibDecimalFloat.sol"; /// @title LibParseNamedLHSTest contract LibParseNamedLHSTest is Test { diff --git a/test/src/lib/parse/LibParseOperand.parseOperand.t.sol b/test/src/lib/parse/LibParseOperand.parseOperand.t.sol index 3d832975..78a54b2e 100644 --- a/test/src/lib/parse/LibParseOperand.parseOperand.t.sol +++ b/test/src/lib/parse/LibParseOperand.parseOperand.t.sol @@ -10,8 +10,8 @@ import {LibMetaFixture} from "test/lib/parse/LibMetaFixture.sol"; import {LibLiteralString} from "test/lib/literal/LibLiteralString.sol"; import {OperandValuesOverflow, UnclosedOperand} from "src/error/ErrParse.sol"; import {LibParseLiteral} from "src/lib/parse/literal/LibParseLiteral.sol"; -import {LibDecimalFloat, LibDecimalFloatImplementation} from "rain.math.float/src/lib/LibDecimalFloat.sol"; -import {SIGNED_NORMALIZED_MAX} from "rain.math.float/src/lib/implementation/LibDecimalFloatImplementation.sol"; +import {LibDecimalFloat, LibDecimalFloatImplementation} from "rain.math.float/lib/LibDecimalFloat.sol"; +import {SIGNED_NORMALIZED_MAX} from "rain.math.float/lib/implementation/LibDecimalFloatImplementation.sol"; contract LibParseOperandParseOperandTest is Test { using LibBytes for bytes; @@ -43,6 +43,7 @@ contract LibParseOperandParseOperandTest is Test { // Test that parsing a string that doesn't start with the operand opening // character always results in a zero length operand values array. + /// forge-config: default.fuzz.runs = 100 function testParseOperandNoOpeningCharacter(string memory s) external pure { vm.assume(bytes(s).length > 0); vm.assume(bytes(s)[0] != "<"); @@ -53,6 +54,7 @@ contract LibParseOperandParseOperandTest is Test { // Test that parsing an empty "<>" operand results in a zero length operand // values array. The cursor moves past both the opening and closing // characters. + /// forge-config: default.fuzz.runs = 100 function testParseOperandEmptyOperand(string memory s) external pure { vm.assume(bytes(s).length > 2); bytes(s)[0] = "<"; @@ -62,6 +64,7 @@ contract LibParseOperandParseOperandTest is Test { } // Test that we can parse a single literal. + /// forge-config: default.fuzz.runs = 100 function testParseOperandSingleDecimalLiteral( bool asHex, int256 value, @@ -89,6 +92,7 @@ contract LibParseOperandParseOperandTest is Test { } // Test that we can parse two literals. + /// forge-config: default.fuzz.runs = 100 function testParseOperandTwoDecimalLiterals( bool asHexA, bool asHexB, @@ -131,6 +135,7 @@ contract LibParseOperandParseOperandTest is Test { } // Test that we can parse three literals. + /// forge-config: default.fuzz.runs = 100 function testParseOperandThreeDecimalLiterals( bool asHexA, bool asHexB, @@ -191,6 +196,7 @@ contract LibParseOperandParseOperandTest is Test { } // Test that we can parse four literals. + /// forge-config: default.fuzz.runs = 100 function testParseOperandFourDecimalLiterals( bool[4] memory asHex, int256[4] memory values, diff --git a/test/src/lib/parse/LibParsePragma.keyword.t.sol b/test/src/lib/parse/LibParsePragma.keyword.t.sol index 12b090f9..493c492e 100644 --- a/test/src/lib/parse/LibParsePragma.keyword.t.sol +++ b/test/src/lib/parse/LibParsePragma.keyword.t.sol @@ -67,6 +67,7 @@ contract LibParsePragmaKeywordTest is Test { } /// Anything that DOES NOT start with the keyword should be a noop. + /// forge-config: default.fuzz.runs = 100 function testPragmaKeywordNoop(ParseState memory state, string calldata calldataStr) external pure { if (bytes(calldataStr).length >= PRAGMA_KEYWORD_BYTES_LENGTH) { bytes memory prefix = bytes(calldataStr)[0:PRAGMA_KEYWORD_BYTES_LENGTH]; @@ -82,6 +83,7 @@ contract LibParsePragmaKeywordTest is Test { /// Anything that DOES start with the keyword but WITHOUT whitespace should /// error. + /// forge-config: default.fuzz.runs = 100 function testPragmaKeywordNoWhitespace(uint256 seed, string memory str) external { bytes1 notWhitespace = LibLiteralString.charFromMask(seed, ~CMASK_WHITESPACE); string memory fullString = @@ -93,6 +95,7 @@ contract LibParsePragmaKeywordTest is Test { /// Anything that DOES start with the keyword and WITH whitespace BUT NOT /// hex values should more the cursor forward exactly the length of the /// keyword + the whitespace char. + /// forge-config: default.fuzz.runs = 100 function testPragmaKeywordWhitespaceNoHex(uint256 seed, string calldata calldataStr) external pure { seed = bound(seed, 0, type(uint256).max - 1); bytes1 whitespace = LibLiteralString.charFromMask(seed, CMASK_WHITESPACE); @@ -117,6 +120,7 @@ contract LibParsePragmaKeywordTest is Test { /// Anything that DOES start with the keyword and WITH whitespace then some /// hex address should push the hex address to the state as a sub parser. + /// forge-config: default.fuzz.runs = 100 function testPragmaKeywordParseSubParser( string memory whitespace, address subParser, @@ -153,6 +157,7 @@ contract LibParsePragmaKeywordTest is Test { } /// Can parse a couple of addresses cleanly. + /// forge-config: default.fuzz.runs = 100 function testPragmaKeywordParseSubParserCoupleOfAddresses( string memory whitespace0, string memory whitespace1,