Skip to content

Commit

Permalink
FF-2498 fix more floating point issues (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
greghuels authored Jun 25, 2024
1 parent f4c6db1 commit 33d4d81
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ufc/tests/test-case-numeric-flag.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"flag": "numeric_flag",
"variationType": "NUMERIC",
"defaultValue": 0,
"defaultValue": 0.0,
"subjects": [
{
"subjectKey": "alice",
Expand Down
14 changes: 7 additions & 7 deletions ufc/tests/test-flag-that-does-not-exist.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"flag": "flag-that-does-not-exist",
"variationType": "NUMERIC",
"defaultValue": 0,
"defaultValue": 0.0,
"subjects": [
{
"subjectKey": "alice",
"subjectAttributes": {
"email": "[email protected]",
"country": "US"
},
"assignment": 0,
"assignment": 0.0,
"assignmentDetails": {
"value": 0,
"value": 0.0,
"flagEvaluationCode": "FLAG_UNRECOGNIZED_OR_DISABLED",
"flagEvaluationDescription": "Unrecognized or disabled flag: flag-that-does-not-exist",
"variationKey": null,
Expand All @@ -28,9 +28,9 @@
"email": "[email protected]",
"country": "Canada"
},
"assignment": 0,
"assignment": 0.0,
"assignmentDetails": {
"value": 0,
"value": 0.0,
"flagEvaluationCode": "FLAG_UNRECOGNIZED_OR_DISABLED",
"flagEvaluationDescription": "Unrecognized or disabled flag: flag-that-does-not-exist",
"variationKey": null,
Expand All @@ -46,9 +46,9 @@
"subjectAttributes": {
"age": 50
},
"assignment": 0,
"assignment": 0.0,
"assignmentDetails": {
"value": 0,
"value": 0.0,
"flagEvaluationCode": "FLAG_UNRECOGNIZED_OR_DISABLED",
"flagEvaluationDescription": "Unrecognized or disabled flag: flag-that-does-not-exist",
"variationKey": null,
Expand Down
18 changes: 15 additions & 3 deletions ufc/tests/test-json-config-flag.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
"flagEvaluationCode": "MATCH",
"flagEvaluationDescription": "alice belongs to the range of traffic assigned to \"one\" defined in allocation \"50/50 split\".",
"variationKey": "one",
"variationValue": "{ \"integer\": 1, \"string\": \"one\", \"float\": 1.0 }",
"variationValue": {
"integer": 1,
"string": "one",
"float": 1.0
},
"matchedRule": null,
"matchedAllocation": {
"key": "50/50 split",
Expand Down Expand Up @@ -54,7 +58,11 @@
"flagEvaluationCode": "MATCH",
"flagEvaluationDescription": "bob belongs to the range of traffic assigned to \"two\" defined in allocation \"50/50 split\".",
"variationKey": "two",
"variationValue": "{ \"integer\": 2, \"string\": \"two\", \"float\": 2.0 }",
"variationValue": {
"integer": 2,
"string": "two",
"float": 2.0
},
"matchedRule": null,
"matchedAllocation": {
"key": "50/50 split",
Expand Down Expand Up @@ -84,7 +92,11 @@
"flagEvaluationCode": "MATCH",
"flagEvaluationDescription": "charlie belongs to the range of traffic assigned to \"two\" defined in allocation \"50/50 split\".",
"variationKey": "two",
"variationValue": "{ \"integer\": 2, \"string\": \"two\", \"float\": 2.0 }",
"variationValue": {
"integer": 2,
"string": "two",
"float": 2.0
},
"matchedRule": null,
"matchedAllocation": {
"key": "50/50 split",
Expand Down

0 comments on commit 33d4d81

Please sign in to comment.