use super::*; from_examples!(DMN_3_0012); #[bench] fn _0001(b: &mut Bencher) { let ctx = context(r#"{list1: ["a","b","c"],list2: ["x","y","z"]}"#); let invocable_name = "listContainsList"; assert_decision(&MODEL_EVALUATOR, &MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx, r#"false"#); iter!(b, MODEL_EVALUATOR.evaluate_invocable(&MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx)); } #[bench] fn _0002(b: &mut Bencher) { let ctx = context(r#"{ string1: "OK", list2: ["x", "y", "z"] }"#); let invocable_name = "listContains"; assert_decision(&MODEL_EVALUATOR, &MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx, r#"false"#); iter!(b, MODEL_EVALUATOR.evaluate_invocable(&MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx)); } #[bench] fn _0003(b: &mut Bencher) { let ctx = context(r#"{ list1: ["a", "b", "c"] }"#); let invocable_name = "count1"; assert_decision(&MODEL_EVALUATOR, &MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx, r#"3"#); iter!(b, MODEL_EVALUATOR.evaluate_invocable(&MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx)); } #[bench] fn _0004(b: &mut Bencher) { let ctx = context(r#"{ numList: [6, 14, -3] }"#); let invocable_name = "min1"; assert_decision(&MODEL_EVALUATOR, &MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx, r#"-3"#); iter!(b, MODEL_EVALUATOR.evaluate_invocable(&MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx)); } #[bench] fn _0006(b: &mut Bencher) { let ctx = context(r#"{ numList: [6, 14, -3] }"#); let invocable_name = "sum1"; assert_decision(&MODEL_EVALUATOR, &MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx, r#"17"#); iter!(b, MODEL_EVALUATOR.evaluate_invocable(&MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx)); } #[bench] fn _0007(b: &mut Bencher) { let ctx = context(r#"{ numList: [6, 14, -3] }"#); let invocable_name = "mean1"; assert_decision( &MODEL_EVALUATOR, &MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx, r#"5.666666666666666666666666666666667"#, ); iter!(b, MODEL_EVALUATOR.evaluate_invocable(&MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx)); } #[bench] fn _0008(b: &mut Bencher) { let ctx = context(r#"{ num1: 11, num2: 2, num3: 10 }"#); let invocable_name = "mean2"; assert_decision( &MODEL_EVALUATOR, &MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx, r#"7.666666666666666666666666666666667"#, ); iter!(b, MODEL_EVALUATOR.evaluate_invocable(&MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx)); } #[bench] fn _0009(b: &mut Bencher) { let ctx = context(r#"{ list1: ["a", "b", "c"] }"#); let invocable_name = "sublist12"; assert_decision(&MODEL_EVALUATOR, &MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx, r#"["a", "b"]"#); iter!(b, MODEL_EVALUATOR.evaluate_invocable(&MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx)); } #[bench] fn _0010(b: &mut Bencher) { let ctx = context(r#"{ list1: ["a", "b", "c"] }"#); let invocable_name = "sublistLast"; assert_decision(&MODEL_EVALUATOR, &MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx, r#"["c"]"#); iter!(b, MODEL_EVALUATOR.evaluate_invocable(&MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx)); } #[bench] fn _0011(b: &mut Bencher) { let ctx = context(r#"{ num1: 11, num2: 2, num3: 10, numList: [6, 14, -3] }"#); let invocable_name = "append1"; assert_decision(&MODEL_EVALUATOR, &MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx, r#"[6, 14, -3, 11, 2]"#); iter!(b, MODEL_EVALUATOR.evaluate_invocable(&MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx)); } #[bench] fn _0012(b: &mut Bencher) { let ctx = context(r#"{ list1: ["a", "b", "c"], list2: ["x", "y", "z"] }"#); let invocable_name = "concatenate1"; assert_decision(&MODEL_EVALUATOR, &MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx, r#"["a", "b", "c", "x", "y", "z"]"#); iter!(b, MODEL_EVALUATOR.evaluate_invocable(&MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx)); } #[bench] fn _0013(b: &mut Bencher) { let ctx = context(r#"{ string1: "OK", list2: ["x", "y", "z"] }"#); let invocable_name = "insertBefore1"; assert_decision(&MODEL_EVALUATOR, &MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx, r#"["x", "OK", "y", "z"]"#); iter!(b, MODEL_EVALUATOR.evaluate_invocable(&MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx)); } #[bench] fn _0014(b: &mut Bencher) { let ctx = context(r#"{ list2: ["x", "y", "z"] }"#); let invocable_name = "remove2nd"; assert_decision(&MODEL_EVALUATOR, &MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx, r#"["x", "z"]"#); iter!(b, MODEL_EVALUATOR.evaluate_invocable(&MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx)); } #[bench] fn _0015(b: &mut Bencher) { let ctx = context(r#"{ list1: ["a", "b", "c"], list2: ["x", "y", "z"] }"#); let invocable_name = "reverse1"; assert_decision(&MODEL_EVALUATOR, &MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx, r#"["z", "y", "x", "c", "b", "a"]"#); iter!(b, MODEL_EVALUATOR.evaluate_invocable(&MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx)); } #[bench] fn _0016(b: &mut Bencher) { let ctx = context(r#"{ list1: ["a", "b", "c"], string1: "x" }"#); let invocable_name = "appendListItem"; assert_decision(&MODEL_EVALUATOR, &MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx, r#"["a", "b", "c", "x"]"#); iter!(b, MODEL_EVALUATOR.evaluate_invocable(&MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx)); } #[bench] fn _0017(b: &mut Bencher) { let ctx = context(r#"{ string1: "OK", list2: ["x", "y", "z"] }"#); let invocable_name = "indexOf1"; assert_decision(&MODEL_EVALUATOR, &MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx, r#"[]"#); iter!(b, MODEL_EVALUATOR.evaluate_invocable(&MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx)); } #[bench] fn _0018(b: &mut Bencher) { let ctx = context(r#"{ string1: "OK", list1: ["a", "b", "c"], list2: ["x", "y", "z"] }"#); let invocable_name = "union1"; assert_decision( &MODEL_EVALUATOR, &MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx, r#"["x", "OK", "y", "z", "a", "b", "c"]"#, ); iter!(b, MODEL_EVALUATOR.evaluate_invocable(&MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx)); } #[bench] fn _0019(b: &mut Bencher) { let ctx = context(r#"{ string1: "OK", list2: ["x", "y", "z"] }"#); let invocable_name = "distinctVals"; assert_decision(&MODEL_EVALUATOR, &MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx, r#"["x", "OK", "y", "z"]"#); iter!(b, MODEL_EVALUATOR.evaluate_invocable(&MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx)); } #[bench] fn _0020(b: &mut Bencher) { let ctx = context(r#"{ list1: ["a", "b", "c"], list2: ["x", "y", "z"] }"#); let invocable_name = "flatten1"; assert_decision(&MODEL_EVALUATOR, &MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx, r#"["a", "b", "c", "x", "y", "z"]"#); iter!(b, MODEL_EVALUATOR.evaluate_invocable(&MODEL_NAMESPACE, &MODEL_NAME, invocable_name, &ctx)); }