[{"data":1,"prerenderedAt":1583},["ShallowReactive",2],{"doc-progmasoft-properties":3},{"id":4,"title":5,"body":6,"description":1574,"extension":1575,"meta":1576,"navigation":145,"path":1577,"seo":1578,"slug":1579,"source":1580,"stem":1581,"__hash__":1582},"docs\u002Fdocs\u002Fprogmasoft-properties.md","Native property testing",{"type":7,"value":8,"toc":1562},"minimark",[9,13,21,96,113,118,352,366,524,547,551,566,782,798,804,808,819,841,844,847,855,862,866,1007,1011,1025,1083,1087,1093,1097,1106,1110,1116,1425,1431,1435,1441,1501,1540,1543,1547,1558],[10,11,5],"h1",{"id":12},"native-property-testing",[14,15,16,20],"p",{},[17,18,19],"code",{},"\u003CProgmasoft\u002FCatch3\u002FForAll.hpp>"," is Catch3's own property-testing engine. It\nneeds no third-party library. Catch2's support for RapidCheck through\nRapidCheck's own Catch integration keeps working as before, but the Progmasoft\nadditions do not build on RapidCheck. The engine goes beyond it where property\ntests usually stop being practical:",[22,23,24,43,49,59,68,87],"ul",{},[25,26,27,31,32,35,36,35,39,42],"li",{},[28,29,30],"strong",{},"Shrinking of the recorded choices."," Every combination of strategies\nshrinks, including ",[17,33,34],{},"Map",", ",[17,37,38],{},"Filter",[17,40,41],{},"FlatMap"," and state machines, and a\nshrunk input always satisfies the filters and dependencies that built it.",[25,44,45,48],{},[28,46,47],{},"An example database."," Failures found once are replayed first on the next\nrun, on any machine that shares the directory, until they are fixed.",[25,50,51,54,55,58],{},[28,52,53],{},"Targeted search."," ",[17,56,57],{},"Target"," scores guide a search towards inputs that\nrandom sampling rarely reaches.",[25,60,61,54,64,67],{},[28,62,63],{},"Coverage requirements.",[17,65,66],{},"Cover"," fails a property whose inputs reach an\ninteresting case too rarely.",[25,69,70,54,73,35,76,35,79,82,83,86],{},[28,71,72],{},"Ready-made oracles.",[17,74,75],{},"Equivalent",[17,77,78],{},"Metamorphic",[17,80,81],{},"RoundTrip"," and\n",[17,84,85],{},"Idempotent"," check properties that need no expected result.",[25,88,89,54,92,95],{},[28,90,91],{},"No exceptions required.",[17,93,94],{},"CATCH3_PROPERTY_ASSERT"," returns from the body;\nthe engine never throws.",[14,97,98,99,102,103,106,107,112],{},"The older ",[17,100,101],{},"CheckProperty"," and ",[17,104,105],{},"Generator"," API of\n",[108,109,111],"a",{"href":110},"\u002Fdocs\u002Fprogmasoft-catch3\u002F","Progmasoft Catch3 additions"," remains supported\nand unchanged.",[114,115,117],"h2",{"id":116},"a-first-property","A first property",[119,120,125],"pre",{"className":121,"code":122,"language":123,"meta":124,"style":124},"language-cpp shiki shiki-themes github-dark","#include \u003CProgmasoft\u002FCatch3.hpp>\n\nusing namespace Progmasoft::Catch3;\n\nTEST_CASE( \"reversing twice gives the original\", \"[property]\" ) {\n    CATCH3_CHECK_FOR_ALL(\n        Gen::Vectors( Gen::Integers\u003Cint>() ),\n        []( const std::vector\u003Cint>& values ) {\n            auto copy = values;\n            std::reverse( copy.begin(), copy.end() );\n            std::reverse( copy.begin(), copy.end() );\n            return copy == values;\n        } );\n}\n","cpp","",[17,126,127,140,147,170,175,195,204,234,267,282,308,327,340,346],{"__ignoreMap":124},[128,129,132,136],"span",{"class":130,"line":131},"line",1,[128,133,135],{"class":134},"snl16","#include",[128,137,139],{"class":138},"sU2Wk"," \u003CProgmasoft\u002FCatch3.hpp>\n",[128,141,143],{"class":130,"line":142},2,[128,144,146],{"emptyLinePlaceholder":145},true,"\n",[128,148,150,153,156,160,164,167],{"class":130,"line":149},3,[128,151,152],{"class":134},"using",[128,154,155],{"class":134}," namespace",[128,157,159],{"class":158},"svObZ"," Progmasoft",[128,161,163],{"class":162},"s95oV","::",[128,165,166],{"class":158},"Catch3",[128,168,169],{"class":162},";\n",[128,171,173],{"class":130,"line":172},4,[128,174,146],{"emptyLinePlaceholder":145},[128,176,178,181,184,187,189,192],{"class":130,"line":177},5,[128,179,180],{"class":158},"TEST_CASE",[128,182,183],{"class":162},"( ",[128,185,186],{"class":138},"\"reversing twice gives the original\"",[128,188,35],{"class":162},[128,190,191],{"class":138},"\"[property]\"",[128,193,194],{"class":162}," ) {\n",[128,196,198,201],{"class":130,"line":197},6,[128,199,200],{"class":158},"    CATCH3_CHECK_FOR_ALL",[128,202,203],{"class":162},"(\n",[128,205,207,210,212,215,217,220,222,225,228,231],{"class":130,"line":206},7,[128,208,209],{"class":158},"        Gen",[128,211,163],{"class":162},[128,213,214],{"class":158},"Vectors",[128,216,183],{"class":162},[128,218,219],{"class":158},"Gen",[128,221,163],{"class":162},[128,223,224],{"class":158},"Integers",[128,226,227],{"class":162},"\u003C",[128,229,230],{"class":134},"int",[128,232,233],{"class":162},">() ),\n",[128,235,237,240,243,246,248,251,253,255,258,261,265],{"class":130,"line":236},8,[128,238,239],{"class":162},"        []( ",[128,241,242],{"class":134},"const",[128,244,245],{"class":158}," std",[128,247,163],{"class":162},[128,249,250],{"class":158},"vector",[128,252,227],{"class":162},[128,254,230],{"class":134},[128,256,257],{"class":162},">",[128,259,260],{"class":134},"&",[128,262,264],{"class":263},"s9osk"," values",[128,266,194],{"class":162},[128,268,270,273,276,279],{"class":130,"line":269},9,[128,271,272],{"class":134},"            auto",[128,274,275],{"class":162}," copy ",[128,277,278],{"class":134},"=",[128,280,281],{"class":162}," values;\n",[128,283,285,288,290,293,296,299,302,305],{"class":130,"line":284},10,[128,286,287],{"class":158},"            std",[128,289,163],{"class":162},[128,291,292],{"class":158},"reverse",[128,294,295],{"class":162},"( copy.",[128,297,298],{"class":158},"begin",[128,300,301],{"class":162},"(), copy.",[128,303,304],{"class":158},"end",[128,306,307],{"class":162},"() );\n",[128,309,311,313,315,317,319,321,323,325],{"class":130,"line":310},11,[128,312,287],{"class":158},[128,314,163],{"class":162},[128,316,292],{"class":158},[128,318,295],{"class":162},[128,320,298],{"class":158},[128,322,301],{"class":162},[128,324,304],{"class":158},[128,326,307],{"class":162},[128,328,330,333,335,338],{"class":130,"line":329},12,[128,331,332],{"class":134},"            return",[128,334,275],{"class":162},[128,336,337],{"class":134},"==",[128,339,281],{"class":162},[128,341,343],{"class":130,"line":342},13,[128,344,345],{"class":162},"        } );\n",[128,347,349],{"class":130,"line":348},14,[128,350,351],{"class":162},"}\n",[14,353,354,357,358,361,362,365],{},[17,355,356],{},"ForAll([options,] strategy..., body)"," draws one value from each strategy and\npasses them to the body. The body returns ",[17,359,360],{},"bool",", or returns ",[17,363,364],{},"void"," and uses\nthe property macros:",[119,367,369],{"className":121,"code":368,"language":123,"meta":124,"style":124},"CATCH3_CHECK_FOR_ALL(\n    Gen::Integers\u003Cint>( -1000, 1000 ), Gen::Integers\u003Cint>( 1, 50 ),\n    []( int value, int divisor ) {\n        CATCH3_PROPERTY_ASSUME( value % divisor == 0 ); \u002F\u002F otherwise discard\n        Note( \"quotient\", value \u002F divisor );           \u002F\u002F part of the report\n        CATCH3_PROPERTY_ASSERT( value \u002F divisor * divisor == value );\n    } );\n",[17,370,371,378,431,450,476,498,519],{"__ignoreMap":124},[128,372,373,376],{"class":130,"line":131},[128,374,375],{"class":158},"CATCH3_CHECK_FOR_ALL",[128,377,203],{"class":162},[128,379,380,383,385,387,389,391,394,397,401,403,405,408,410,412,414,416,418,420,423,425,428],{"class":130,"line":142},[128,381,382],{"class":158},"    Gen",[128,384,163],{"class":162},[128,386,224],{"class":158},[128,388,227],{"class":162},[128,390,230],{"class":134},[128,392,393],{"class":162},">( ",[128,395,396],{"class":134},"-",[128,398,400],{"class":399},"sDLfK","1000",[128,402,35],{"class":162},[128,404,400],{"class":399},[128,406,407],{"class":162}," ), ",[128,409,219],{"class":158},[128,411,163],{"class":162},[128,413,224],{"class":158},[128,415,227],{"class":162},[128,417,230],{"class":134},[128,419,393],{"class":162},[128,421,422],{"class":399},"1",[128,424,35],{"class":162},[128,426,427],{"class":399},"50",[128,429,430],{"class":162}," ),\n",[128,432,433,436,438,441,443,445,448],{"class":130,"line":149},[128,434,435],{"class":162},"    []( ",[128,437,230],{"class":134},[128,439,440],{"class":263}," value",[128,442,35],{"class":162},[128,444,230],{"class":134},[128,446,447],{"class":263}," divisor",[128,449,194],{"class":162},[128,451,452,455,458,461,464,466,469,472],{"class":130,"line":172},[128,453,454],{"class":158},"        CATCH3_PROPERTY_ASSUME",[128,456,457],{"class":162},"( value ",[128,459,460],{"class":134},"%",[128,462,463],{"class":162}," divisor ",[128,465,337],{"class":134},[128,467,468],{"class":399}," 0",[128,470,471],{"class":162}," );",[128,473,475],{"class":474},"sAwPA"," \u002F\u002F otherwise discard\n",[128,477,478,481,483,486,489,492,495],{"class":130,"line":177},[128,479,480],{"class":158},"        Note",[128,482,183],{"class":162},[128,484,485],{"class":138},"\"quotient\"",[128,487,488],{"class":162},", value ",[128,490,491],{"class":134},"\u002F",[128,493,494],{"class":162}," divisor );",[128,496,497],{"class":474},"           \u002F\u002F part of the report\n",[128,499,500,503,505,507,509,512,514,516],{"class":130,"line":197},[128,501,502],{"class":158},"        CATCH3_PROPERTY_ASSERT",[128,504,457],{"class":162},[128,506,491],{"class":134},[128,508,463],{"class":162},[128,510,511],{"class":134},"*",[128,513,463],{"class":162},[128,515,337],{"class":134},[128,517,518],{"class":162}," value );\n",[128,520,521],{"class":130,"line":206},[128,522,523],{"class":162},"    } );\n",[14,525,526,102,528,531,532,535,536,539,540,102,543,546],{},[17,527,375],{},[17,529,530],{},"CATCH3_REQUIRE_FOR_ALL"," report through Catch2's\nnormal assertion path. ",[17,533,534],{},"ForAll"," itself returns a ",[17,537,538],{},"PropertyResult"," for code\nthat wants to inspect it. Catch2's own ",[17,541,542],{},"CHECK",[17,544,545],{},"REQUIRE"," should not be\nused inside a property body: the engine runs the body many times while it\nshrinks, and every run would be reported.",[114,548,550],{"id":549},"strategies","Strategies",[14,552,553,554,557,558,561,562,565],{},"A ",[17,555,556],{},"Strategy\u003CT>"," builds values of ",[17,559,560],{},"T",". All strategies live in\n",[17,563,564],{},"Progmasoft::Catch3::Gen",":",[567,568,569,585],"table",{},[570,571,572],"thead",{},[573,574,575,579,582],"tr",{},[576,577,578],"th",{},"Strategy",[576,580,581],{},"Values",[576,583,584],{},"Shrinks towards",[586,587,588,602,621,634,650,666,688,705,721,734,750,766],"tbody",{},[573,589,590,596,599],{},[591,592,593],"td",{},[17,594,595],{},"Integers\u003CT>(min, max)",[591,597,598],{},"integers of the range",[591,600,601],{},"the value closest to zero",[573,603,604,609,617],{},[591,605,606],{},[17,607,608],{},"Booleans()",[591,610,611,35,614],{},[17,612,613],{},"true",[17,615,616],{},"false",[591,618,619],{},[17,620,616],{},[573,622,623,628,631],{},[591,624,625],{},[17,626,627],{},"Floats\u003CT>(FloatOptions)",[591,629,630],{},"finite values of the range; NaN and infinities on request",[591,632,633],{},"zero or the bound closest to it, then integral values",[573,635,636,644,647],{},[591,637,638,35,641],{},[17,639,640],{},"Characters(alphabet)",[17,642,643],{},"PrintableCharacters()",[591,645,646],{},"characters",[591,648,649],{},"the first character of the alphabet",[573,651,652,660,663],{},[591,653,654,35,657],{},[17,655,656],{},"Strings(character, range)",[17,658,659],{},"Utf8Strings(range, min, max)",[591,661,662],{},"byte strings; UTF-8 text without surrogates",[591,664,665],{},"shorter text, simpler characters",[573,667,668,682,685],{},[591,669,670,35,673,35,676,35,679],{},[17,671,672],{},"Vectors(element, range)",[17,674,675],{},"UniqueVectors",[17,677,678],{},"Sets",[17,680,681],{},"Maps",[591,683,684],{},"collections",[591,686,687],{},"fewer and simpler elements",[573,689,690,695,701],{},[591,691,692],{},[17,693,694],{},"Optionals(value)",[591,696,697,700],{},[17,698,699],{},"std::nullopt"," or a value",[591,702,703],{},[17,704,699],{},[573,706,707,715,718],{},[591,708,709,35,712],{},[17,710,711],{},"Tuples(a, b, ...)",[17,713,714],{},"Construct\u003CT>(a, b, ...)",[591,716,717],{},"tuples, and objects built with braces",[591,719,720],{},"each component",[573,722,723,728,731],{},[591,724,725],{},[17,726,727],{},"Permutations(values)",[591,729,730],{},"orderings of a list",[591,732,733],{},"the original order",[573,735,736,744,747],{},[591,737,738,35,741],{},[17,739,740],{},"Just(value)",[17,742,743],{},"SampledFrom(values)",[591,745,746],{},"fixed values",[591,748,749],{},"the first value",[573,751,752,760,763],{},[591,753,754,35,757],{},[17,755,756],{},"OneOf(a, b, ...)",[17,758,759],{},"Frequency({ {weight, strategy}, ... })",[591,761,762],{},"one of several strategies",[591,764,765],{},"the first strategy",[573,767,768,776,779],{},[591,769,770,35,773],{},[17,771,772],{},"Lazy(factory)",[17,774,775],{},"Recursive(base, extend, depth)",[591,777,778],{},"self-referential and recursive structures",[591,780,781],{},"a leaf",[14,783,784,785,35,788,82,791,794,795,797],{},"Every strategy has ",[17,786,787],{},"Map(function)",[17,789,790],{},"Filter(predicate)",[17,792,793],{},"FlatMap(function)",". ",[17,796,41],{}," draws a value and then a second strategy that\ndepends on it, for example a size and then a vector of exactly that size.",[14,799,553,800,803],{},[17,801,802],{},"SizeRange{ minimum, maximum }"," bounds a collection. Without a maximum the\nlength grows with the size of the trial, which rises from 0 to 100 over the\nfirst half of the trials, so the first trials try small inputs.",[114,805,807],{"id":806},"how-shrinking-works","How shrinking works",[14,809,810,811,814,815,818],{},"Each strategy builds its value from a sequence of choices, small integers that\na ",[17,812,813],{},"ChoiceSource"," hands out. During a trial the engine records them. When a\ntrial fails, the engine does not shrink the value; it shrinks the recorded\nchoices and replays them through the same strategies. Choice 0 is always the\nsimplest decision, and a shorter sequence is simpler than a longer one. Five\npasses repeat until none helps or ",[17,816,817],{},"MaxShrinkSteps"," replays are used:",[820,821,822,825,828,831,834],"ol",{},[25,823,824],{},"delete blocks of 16, 8, 4, 2 and 1 choices, which drops collection\nelements and command steps;",[25,826,827],{},"set blocks to zero;",[25,829,830],{},"lower each choice by binary search, then by single steps for conditions\nthat are not monotone;",[25,832,833],{},"swap neighbours that are out of order;",[25,835,836,837,840],{},"move a unit from a choice to a later one, for sums such as ",[17,838,839],{},"x + y > 10",".",[14,842,843],{},"Because the strategies are replayed, the shrunk input is always one the\nstrategies can produce: a filter is still satisfied, a dependent size still\nmatches its vector, a state machine still respects its preconditions. That is\nthe difference from shrinking values directly.",[14,845,846],{},"The report shows the minimized input, the reason, the notes, and a replay\ntoken:",[119,848,853],{"className":849,"code":851,"language":852,"meta":124},[850],"language-text","property failed after 37 trials; failing trial 37, root seed 3359259219, shrink checks 112\ncounterexample: { 0, 100 }\nreason: property returned false\nreplay: set PropertyOptions::Replay to \"c3.3c.0-0-2s\"\n","text",[17,854,851],{"__ignoreMap":124},[14,856,857,858,861],{},"Setting ",[17,859,860],{},"PropertyOptions::Replay"," to the token runs exactly that input once,\nwithout trials or shrinking.",[114,863,865],{"id":864},"options","Options",[567,867,868,881],{},[570,869,870],{},[573,871,872,875,878],{},[576,873,874],{},"Field",[576,876,877],{},"Default",[576,879,880],{},"Meaning",[586,882,883,896,909,920,933,946,961,976,989],{},[573,884,885,890,893],{},[591,886,887],{},[17,888,889],{},"Trials",[591,891,892],{},"100",[591,894,895],{},"valid trials to run",[573,897,898,903,906],{},[591,899,900],{},[17,901,902],{},"Seed",[591,904,905],{},"fixed",[591,907,908],{},"root seed; every trial derives its own seed from it",[573,910,911,915,917],{},[591,912,913],{},[17,914,817],{},[591,916,400],{},[591,918,919],{},"replays the shrinker may use",[573,921,922,927,930],{},[591,923,924],{},[17,925,926],{},"Replay",[591,928,929],{},"none",[591,931,932],{},"run only the input of a replay token",[573,934,935,940,943],{},[591,936,937],{},[17,938,939],{},"MaxDiscardRatio",[591,941,942],{},"10",[591,944,945],{},"discarded trials allowed per requested trial before the property gives up",[573,947,948,953,956],{},[591,949,950],{},[17,951,952],{},"TargetSteps",[591,954,955],{},"500",[591,957,958,959],{},"steps of targeted search when the body calls ",[17,960,57],{},[573,962,963,968,970],{},[591,964,965],{},[17,966,967],{},"DatabasePath",[591,969,929],{},[591,971,972,973],{},"directory of the example database; otherwise ",[17,974,975],{},"CATCH3_PROPERTY_DATABASE",[573,977,978,983,986],{},[591,979,980],{},[17,981,982],{},"Name",[591,984,985],{},"test name and line",[591,987,988],{},"names the property in the database",[573,990,991,996,998],{},[591,992,993],{},[17,994,995],{},"ShowStatistics",[591,997,616],{},[591,999,1000,1001,102,1004,1006],{},"adds the ",[17,1002,1003],{},"Classify",[17,1005,66],{}," counts to a passing report",[114,1008,1010],{"id":1009},"statistics-and-coverage-requirements","Statistics and coverage requirements",[14,1012,1013,1016,1017,1020,1021,1024],{},[17,1014,1015],{},"Classify(condition, label)"," counts how often a condition held. ",[17,1018,1019],{},"Cover(percent, condition, label)"," also requires a percentage: a property whose inputs rarely\nreach an interesting case fails with ",[17,1022,1023],{},"kInsufficientCoverage"," instead of\npassing on easy inputs.",[119,1026,1028],{"className":121,"code":1027,"language":123,"meta":124,"style":124},"Cover( 10.0, values.empty(), \"empty\" );\nCover( 30.0, values.size() > 10, \"long\" );\n",[17,1029,1030,1054],{"__ignoreMap":124},[128,1031,1032,1034,1036,1039,1042,1045,1048,1051],{"class":130,"line":131},[128,1033,66],{"class":158},[128,1035,183],{"class":162},[128,1037,1038],{"class":399},"10.0",[128,1040,1041],{"class":162},", values.",[128,1043,1044],{"class":158},"empty",[128,1046,1047],{"class":162},"(), ",[128,1049,1050],{"class":138},"\"empty\"",[128,1052,1053],{"class":162}," );\n",[128,1055,1056,1058,1060,1063,1065,1068,1071,1073,1076,1078,1081],{"class":130,"line":142},[128,1057,66],{"class":158},[128,1059,183],{"class":162},[128,1061,1062],{"class":399},"30.0",[128,1064,1041],{"class":162},[128,1066,1067],{"class":158},"size",[128,1069,1070],{"class":162},"() ",[128,1072,257],{"class":134},[128,1074,1075],{"class":399}," 10",[128,1077,35],{"class":162},[128,1079,1080],{"class":138},"\"long\"",[128,1082,1053],{"class":162},[114,1084,1086],{"id":1085},"targeted-search","Targeted search",[14,1088,1089,1092],{},[17,1090,1091],{},"Target(score, label)"," reports a score. After the regular trials the engine\ntakes the highest-scoring input of each label and mutates its choices one at a\ntime, keeping a mutation when the score rises. Inputs that random sampling\nalmost never reaches, such as a long chain of operations or a value near an\noverflow, become reachable when a score measures the distance to them.",[114,1094,1096],{"id":1095},"the-example-database","The example database",[14,1098,1099,1100,1102,1103,1105],{},"With ",[17,1101,967],{},", or the ",[17,1104,975],{}," environment variable,\nthe engine stores the replay token of every minimized failure in a file named\nafter the property. The next run replays those tokens before any new trial, so\na failure found once, on any machine that shares the directory, is checked\nfirst until it is fixed; a stored example that passes is removed. The engine\nnever fails a test because the directory is missing or unwritable.",[114,1107,1109],{"id":1108},"model-based-testing","Model-based testing",[14,1111,1112,1115],{},[17,1113,1114],{},"\u003CProgmasoft\u002FCatch3\u002FStateful.hpp>"," runs random sequences of commands against a\nmodel and the system under test side by side:",[119,1117,1119],{"className":121,"code":1118,"language":123,"meta":124,"style":124},"using Model = std::deque\u003Cint>;\n\nCommand\u003CModel, Queue> push{\n    \"push\",\n    []( const Model& ) {\n        return Gen::Integers\u003Cint>( 0, 100 ).Map( []( int value ) {\n            return Action\u003CModel, Queue>{\n                \"push(\" + std::to_string( value ) + \")\",\n                [value]( Model& model, Queue& queue ) {\n                    model.push_back( value );\n                    queue.Push( value );\n                    CATCH3_PROPERTY_ASSERT( queue.Size() == model.size() );\n                } };\n        } );\n    } };\n\nconst auto result = CheckStateful\u003CModel, Queue>(\n    options, [] { return Model{}; },\n    []( const Model& ) { return Queue{}; },\n    { push, pop } );\n",[17,1120,1121,1145,1149,1167,1175,1187,1226,1243,1269,1298,1309,1319,1341,1346,1350,1356,1361,1388,1400,1419],{"__ignoreMap":124},[128,1122,1123,1125,1128,1131,1133,1135,1138,1140,1142],{"class":130,"line":131},[128,1124,152],{"class":134},[128,1126,1127],{"class":158}," Model",[128,1129,1130],{"class":134}," =",[128,1132,245],{"class":158},[128,1134,163],{"class":162},[128,1136,1137],{"class":158},"deque",[128,1139,227],{"class":162},[128,1141,230],{"class":134},[128,1143,1144],{"class":162},">;\n",[128,1146,1147],{"class":130,"line":142},[128,1148,146],{"emptyLinePlaceholder":145},[128,1150,1151,1154,1156,1159,1161,1164],{"class":130,"line":149},[128,1152,1153],{"class":158},"Command",[128,1155,227],{"class":162},[128,1157,1158],{"class":158},"Model",[128,1160,35],{"class":162},[128,1162,1163],{"class":158},"Queue",[128,1165,1166],{"class":162},"> push{\n",[128,1168,1169,1172],{"class":130,"line":172},[128,1170,1171],{"class":138},"    \"push\"",[128,1173,1174],{"class":162},",\n",[128,1176,1177,1179,1181,1183,1185],{"class":130,"line":177},[128,1178,435],{"class":162},[128,1180,242],{"class":134},[128,1182,1127],{"class":158},[128,1184,260],{"class":134},[128,1186,194],{"class":162},[128,1188,1189,1192,1195,1197,1199,1201,1203,1205,1208,1210,1212,1215,1217,1220,1222,1224],{"class":130,"line":197},[128,1190,1191],{"class":134},"        return",[128,1193,1194],{"class":158}," Gen",[128,1196,163],{"class":162},[128,1198,224],{"class":158},[128,1200,227],{"class":162},[128,1202,230],{"class":134},[128,1204,393],{"class":162},[128,1206,1207],{"class":399},"0",[128,1209,35],{"class":162},[128,1211,892],{"class":399},[128,1213,1214],{"class":162}," ).",[128,1216,34],{"class":158},[128,1218,1219],{"class":162},"( []( ",[128,1221,230],{"class":134},[128,1223,440],{"class":263},[128,1225,194],{"class":162},[128,1227,1228,1230,1233,1235,1238,1240],{"class":130,"line":206},[128,1229,332],{"class":134},[128,1231,1232],{"class":162}," Action",[128,1234,227],{"class":134},[128,1236,1237],{"class":162},"Model, Queue",[128,1239,257],{"class":134},[128,1241,1242],{"class":162},"{\n",[128,1244,1245,1248,1251,1253,1255,1258,1261,1264,1267],{"class":130,"line":236},[128,1246,1247],{"class":138},"                \"push(\"",[128,1249,1250],{"class":134}," +",[128,1252,245],{"class":158},[128,1254,163],{"class":162},[128,1256,1257],{"class":158},"to_string",[128,1259,1260],{"class":162},"( value ) ",[128,1262,1263],{"class":134},"+",[128,1265,1266],{"class":138}," \")\"",[128,1268,1174],{"class":162},[128,1270,1271,1274,1277,1280,1282,1284,1287,1289,1291,1293,1296],{"class":130,"line":269},[128,1272,1273],{"class":162},"                [",[128,1275,1276],{"class":263},"value",[128,1278,1279],{"class":162},"]( ",[128,1281,1158],{"class":158},[128,1283,260],{"class":134},[128,1285,1286],{"class":263}," model",[128,1288,35],{"class":162},[128,1290,1163],{"class":158},[128,1292,260],{"class":134},[128,1294,1295],{"class":263}," queue",[128,1297,194],{"class":162},[128,1299,1300,1303,1306],{"class":130,"line":284},[128,1301,1302],{"class":162},"                    model.",[128,1304,1305],{"class":158},"push_back",[128,1307,1308],{"class":162},"( value );\n",[128,1310,1311,1314,1317],{"class":130,"line":310},[128,1312,1313],{"class":162},"                    queue.",[128,1315,1316],{"class":158},"Push",[128,1318,1308],{"class":162},[128,1320,1321,1324,1327,1330,1332,1334,1337,1339],{"class":130,"line":329},[128,1322,1323],{"class":158},"                    CATCH3_PROPERTY_ASSERT",[128,1325,1326],{"class":162},"( queue.",[128,1328,1329],{"class":158},"Size",[128,1331,1070],{"class":162},[128,1333,337],{"class":134},[128,1335,1336],{"class":162}," model.",[128,1338,1067],{"class":158},[128,1340,307],{"class":162},[128,1342,1343],{"class":130,"line":342},[128,1344,1345],{"class":162},"                } };\n",[128,1347,1348],{"class":130,"line":348},[128,1349,345],{"class":162},[128,1351,1353],{"class":130,"line":1352},15,[128,1354,1355],{"class":162},"    } };\n",[128,1357,1359],{"class":130,"line":1358},16,[128,1360,146],{"emptyLinePlaceholder":145},[128,1362,1364,1366,1369,1372,1374,1377,1379,1381,1383,1385],{"class":130,"line":1363},17,[128,1365,242],{"class":134},[128,1367,1368],{"class":134}," auto",[128,1370,1371],{"class":162}," result ",[128,1373,278],{"class":134},[128,1375,1376],{"class":158}," CheckStateful",[128,1378,227],{"class":162},[128,1380,1158],{"class":158},[128,1382,35],{"class":162},[128,1384,1163],{"class":158},[128,1386,1387],{"class":162},">(\n",[128,1389,1391,1394,1397],{"class":130,"line":1390},18,[128,1392,1393],{"class":162},"    options, [] { ",[128,1395,1396],{"class":134},"return",[128,1398,1399],{"class":162}," Model{}; },\n",[128,1401,1403,1405,1407,1409,1411,1414,1416],{"class":130,"line":1402},19,[128,1404,435],{"class":162},[128,1406,242],{"class":134},[128,1408,1127],{"class":158},[128,1410,260],{"class":134},[128,1412,1413],{"class":162}," ) { ",[128,1415,1396],{"class":134},[128,1417,1418],{"class":162}," Queue{}; },\n",[128,1420,1422],{"class":130,"line":1421},20,[128,1423,1424],{"class":162},"    { push, pop } );\n",[14,1426,1427,1428,840],{},"A command builds its action from the current model, so arguments can depend on\nthe state, and its precondition decides whether it may run. A failing sequence\nshrinks to fewer steps with simpler arguments; the report lists the steps, for\nexample ",[17,1429,1430],{},"{ push(0), push(0), push(0), push(0) }",[114,1432,1434],{"id":1433},"ready-made-oracles","Ready-made oracles",[14,1436,1437,1440],{},[17,1438,1439],{},"\u003CProgmasoft\u002FCatch3\u002FRelations.hpp>"," provides bodies for properties that need\nno specification of the expected result:",[567,1442,1443,1453],{},[570,1444,1445],{},[573,1446,1447,1450],{},[576,1448,1449],{},"Body",[576,1451,1452],{},"Checks",[586,1454,1455,1465,1477,1489],{},[573,1456,1457,1462],{},[591,1458,1459],{},[17,1460,1461],{},"Equivalent(reference, candidate)",[591,1463,1464],{},"differential testing: both return the same result",[573,1466,1467,1472],{},[591,1468,1469],{},[17,1470,1471],{},"Metamorphic(function, transform, relation)",[591,1473,1474],{},[17,1475,1476],{},"relation(f(x), f(transform(x)))",[573,1478,1479,1484],{},[591,1480,1481],{},[17,1482,1483],{},"RoundTrip(encode, decode)",[591,1485,1486],{},[17,1487,1488],{},"decode(encode(x)) == x",[573,1490,1491,1496],{},[591,1492,1493],{},[17,1494,1495],{},"Idempotent(function)",[591,1497,1498],{},[17,1499,1500],{},"f(f(x)) == f(x)",[119,1502,1504],{"className":121,"code":1503,"language":123,"meta":124,"style":124},"CATCH3_CHECK_FOR_ALL( Gen::Vectors( Gen::Integers\u003Cint>() ),\n                      Equivalent( ReferenceSort, FastSort ) );\n",[17,1505,1506,1532],{"__ignoreMap":124},[128,1507,1508,1510,1512,1514,1516,1518,1520,1522,1524,1526,1528,1530],{"class":130,"line":131},[128,1509,375],{"class":158},[128,1511,183],{"class":162},[128,1513,219],{"class":158},[128,1515,163],{"class":162},[128,1517,214],{"class":158},[128,1519,183],{"class":162},[128,1521,219],{"class":158},[128,1523,163],{"class":162},[128,1525,224],{"class":158},[128,1527,227],{"class":162},[128,1529,230],{"class":134},[128,1531,233],{"class":162},[128,1533,1534,1537],{"class":130,"line":142},[128,1535,1536],{"class":158},"                      Equivalent",[128,1538,1539],{"class":162},"( ReferenceSort, FastSort ) );\n",[14,1541,1542],{},"A mismatch reports both results as notes.",[114,1544,1546],{"id":1545},"compatibility","Compatibility",[14,1548,1549,1550,1553,1554,1557],{},"The engine is C++17 and part of the ",[17,1551,1552],{},"Catch3::Catch3"," library. It does not\nchange the ",[17,1555,1556],{},"Catch"," namespace, and it needs no exceptions: a client built without them gets the\nsame results, except that an exception thrown by a body cannot be caught.",[1559,1560,1561],"style",{},"html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .s9osk, html code.shiki .s9osk{--shiki-default:#FFAB70}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}",{"title":124,"searchDepth":142,"depth":142,"links":1563},[1564,1565,1566,1567,1568,1569,1570,1571,1572,1573],{"id":116,"depth":142,"text":117},{"id":549,"depth":142,"text":550},{"id":806,"depth":142,"text":807},{"id":864,"depth":142,"text":865},{"id":1009,"depth":142,"text":1010},{"id":1085,"depth":142,"text":1086},{"id":1095,"depth":142,"text":1096},{"id":1108,"depth":142,"text":1109},{"id":1433,"depth":142,"text":1434},{"id":1545,"depth":142,"text":1546},"\u003CProgmasoft\u002FCatch3\u002FForAll.hpp> is Catch3's own property-testing engine. It\nneeds no third-party library. Catch2's support for RapidCheck through\nRapidCheck's own Catch integration keeps working as before, but the Progmasoft\nadditions do not build on RapidCheck. The engine goes beyond it where property\ntests usually stop being practical:","md",{},"\u002Fdocs\u002Fprogmasoft-properties",{"title":5,"description":1574},"progmasoft-properties","docs\u002Fprogmasoft-properties.md","docs\u002Fprogmasoft-properties","0YpQIIsYfGjuiQhTsu2VUnvHGx8AdAUPDrBX7AwXVxA",1794961595292]