当前位置: 首页>>代码示例>>Java>>正文


Java Asserts.assertEquivalenceOperations方法代码示例

本文整理汇总了Java中com.google.javascript.rhino.testing.Asserts.assertEquivalenceOperations方法的典型用法代码示例。如果您正苦于以下问题:Java Asserts.assertEquivalenceOperations方法的具体用法?Java Asserts.assertEquivalenceOperations怎么用?Java Asserts.assertEquivalenceOperations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.javascript.rhino.testing.Asserts的用法示例。


在下文中一共展示了Asserts.assertEquivalenceOperations方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testRecursiveRecord

import com.google.javascript.rhino.testing.Asserts; //导入方法依赖的package包/类
public void testRecursiveRecord() {
  ProxyObjectType loop = new ProxyObjectType(registry, NUMBER_TYPE);
  JSType record = new RecordTypeBuilder(registry)
      .addProperty("loop", loop, null)
      .addProperty("number", NUMBER_TYPE, null)
      .addProperty("string", STRING_TYPE, null)
      .build();
  assertEquals("{loop: number, number: number, string: string}",
      record.toString());

  loop.setReferencedType(record);
  assertEquals("{loop: {...}, number: number, string: string}",
      record.toString());
  assertEquals("{loop: ?, number: number, string: string}",
      record.toAnnotationString());

  Asserts.assertEquivalenceOperations(record, loop);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:19,代码来源:RecordTypeTest.java

示例2: testIsEquivalentToParams

import com.google.javascript.rhino.testing.Asserts; //导入方法依赖的package包/类
public void testIsEquivalentToParams() {
  FunctionType oneNum = new FunctionBuilder(registry)
      .withParamsNode(registry.createParameters(NUMBER_TYPE))
      .build();
  FunctionType optNum = new FunctionBuilder(registry)
      .withParamsNode(registry.createOptionalParameters(NUMBER_TYPE))
      .build();
  FunctionType varNum = new FunctionBuilder(registry)
      .withParamsNode(registry.createParametersWithVarArgs(NUMBER_TYPE))
      .build();
  Asserts.assertEquivalenceOperations(oneNum, oneNum);
  Asserts.assertEquivalenceOperations(optNum, optNum);
  Asserts.assertEquivalenceOperations(varNum, varNum);
  assertFalse(oneNum.isEquivalentTo(optNum));
  assertFalse(oneNum.isEquivalentTo(varNum));
  assertFalse(optNum.isEquivalentTo(varNum));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:18,代码来源:FunctionTypeTest.java

示例3: testRecursiveRecord

import com.google.javascript.rhino.testing.Asserts; //导入方法依赖的package包/类
public void testRecursiveRecord() {
  ProxyObjectType loop = new ProxyObjectType(registry, NUMBER_TYPE);
  JSType record = new RecordTypeBuilder(registry)
      .addProperty("loop", loop, null)
      .addProperty("number", NUMBER_TYPE, null)
      .addProperty("string", STRING_TYPE, null)
      .build();
  assertEquals("{\n  loop: number,\n  number: number,\n  string: string\n}",
      record.toString());

  loop.setReferencedType(record);
  assertEquals("{\n  loop: {...},\n  number: number,\n  string: string\n}",
      record.toString());
  assertEquals("{loop: ?, number: number, string: string}",
      record.toAnnotationString(Nullability.EXPLICIT));

  Asserts.assertEquivalenceOperations(record, loop);
}
 
开发者ID:google,项目名称:closure-compiler,代码行数:19,代码来源:RecordTypeTest.java

示例4: testRecursiveFunction

import com.google.javascript.rhino.testing.Asserts; //导入方法依赖的package包/类
public void testRecursiveFunction() {
  ProxyObjectType loop = new ProxyObjectType(registry, NUMBER_TYPE);
  FunctionType fn = new FunctionBuilder(registry)
      .withParamsNode(registry.createParameters(loop))
      .withReturnType(loop).build();

  loop.setReferencedType(fn);
  assertEquals("function (Function): Function", fn.toString());

  Asserts.assertEquivalenceOperations(fn, loop);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:12,代码来源:FunctionTypeTest.java

示例5: testRecursiveFunction

import com.google.javascript.rhino.testing.Asserts; //导入方法依赖的package包/类
public void testRecursiveFunction() {
  ProxyObjectType loop = new ProxyObjectType(registry, NUMBER_TYPE);
  FunctionType fn = new FunctionBuilder(registry)
      .withParamsNode(registry.createParameters(loop))
      .withReturnType(loop).build();

  loop.setReferencedType(fn);
  assertEquals("function(Function): Function", fn.toString());

  Asserts.assertEquivalenceOperations(fn, loop);
}
 
开发者ID:google,项目名称:closure-compiler,代码行数:12,代码来源:FunctionTypeTest.java


注:本文中的com.google.javascript.rhino.testing.Asserts.assertEquivalenceOperations方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。