Github user jjmeyer0 commented on a diff in the pull request:

    https://github.com/apache/metron/pull/814#discussion_r147544129
  
    --- Diff: 
metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/MatchTest.java
 ---
    @@ -0,0 +1,202 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.metron.stellar.dsl.functions;
    +
    +import static 
org.apache.metron.stellar.common.utils.StellarProcessorUtils.run;
    +import static 
org.apache.metron.stellar.common.utils.StellarProcessorUtils.runPredicate;
    +
    +import com.google.common.collect.ImmutableMap;
    +import java.util.HashMap;
    +import java.util.List;
    +import java.util.Map;
    +import org.apache.metron.stellar.dsl.DefaultVariableResolver;
    +import org.apache.metron.stellar.dsl.ParseException;
    +import org.junit.Assert;
    +import org.junit.Ignore;
    +import org.junit.Test;
    +
    +public class MatchTest {
    +
    +  @Test
    +  @SuppressWarnings("unchecked")
    +  public void testMatchLambda() {
    +    Assert.assertTrue(runPredicate("match { 1 >= 0 : ()-> true }", new 
HashMap() {{
    +      put("foo", 0);
    +    }}));
    +    Assert.assertTrue(
    +        runPredicate("match { foo == 0 : ()-> true, default : ()-> false 
}", new HashMap() {{
    +          put("foo", 0);
    +        }}));
    +
    +    Assert.assertFalse(
    +        runPredicate("match { foo == 0 : ()-> true, default : ()-> false 
}", new HashMap() {{
    +          put("foo", 1);
    +        }}));
    +
    +    Assert.assertTrue(
    +        runPredicate("match { foo == 0 : ()-> false, foo == 1 : ()-> true, 
default : ()-> false }",
    +            new HashMap() {{
    +              put("foo", 1);
    +            }}));
    +
    +    Assert.assertTrue(runPredicate(
    +        "match { foo == 0 : ()-> bFalse, foo == 1 : ()-> bTrue, default : 
()-> bFalse }",
    +        new HashMap() {{
    +          put("foo", 1);
    +          put("bFalse", false);
    +          put("bTrue", true);
    +        }}));
    +
    +    Assert.assertTrue(runPredicate(
    +        "match { foo == 0 : ()-> bFalse, foo == 1 : ()-> bTrue, default : 
()-> bFalse }",
    +        new HashMap() {{
    +          put("foo", 1);
    +          put("bFalse", false);
    +          put("bTrue", true);
    +        }}));
    +
    +  }
    +
    +  @Test
    +  @SuppressWarnings("unchecked")
    +  @Ignore
    +  public void testMatchMAPEvaluation() {
    +
    +    // NOTE: THIS IS BROKEN RIGHT NOW.
    --- End diff --
    
    Can you delete this comment and add it to `@Ignore("NOTE: THIS IS BROKEN 
RIGHT NOW.")` instead? Maybe also mention that it's broken because the use of 
`MAP` is not supported right now. It may even be better to just delete the 
test, as it will probably be written when that feature is implemented. Also, 
this may just be forgotten about.


---

Reply via email to