Exemple #1
0
  @Test
  public void testEquals() throws Exception {
    JsFunction f1 = new JsFunction(ImmutableList.of("arg1"), "these are the contents");
    JsFunction f2 = new JsFunction(ImmutableList.of("arg1"), "these are the contents");
    assertEquals(f1, f2);

    JsFunction f3 = new JsFunction(ImmutableList.of("arg2"), "these are the contents");
    assertFalse(f1.equals(f3));

    JsFunction f4 = new JsFunction(ImmutableList.of("arg1"), "these are not the garden");
    assertFalse(f1.equals(f4));

    JsFunction f5 = new JsFunction(ImmutableList.of("arg1", "arg2"), "these are the contents");
    assertFalse(f1.equals(f5));
  }