⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fromstringtest.java

📁 SRI international 发布的OAA框架软件
💻 JAVA
字号:
/* 
 * Local Variables:
 * c-basic-offset:2
 * tab-width:2
 * indent-tabs-mode:nil
 * End:
 */
package com.sri.oaa2.test.icl;

import com.sri.oaa2.icl.*;

import junit.framework.TestCase;

/**
 * @author agno
 *
 */
public class FromStringTest extends TestCase 
{
  static String[] strings = {
    "a",
    "1",
    "1.0",
    "V",
    "_",
    "hello(there)",
    "{hello}",
    "[hello]",
    "'spaces spaces'",
    "a + b",
    "a :- b",
    ":-(a,b)",
    "{hello,there}",
    "[hello, there]",
    "{g1, 5, _9}",
    "'blah''blah'",
    "hello([there,blah, blah],'blah''blah',{1.5, another(struct,[nested])})",
    "icldataq(\"blah blah\")",
    "<(_6025,43)",
    "[a|V]"
  }
  ;

  public FromStringTest(String arg0)
  {
    super(arg0);
  }

  public void testFromString() 
  {
    for(int i = 0; i < strings.length; ++i) {
      try {
        IclTerm t = IclTerm.fromString(strings[i]);
        TestCase.assertTrue(t != null);
        System.out.println(t.toString());
      }
      catch(Exception e) {
        System.out.println("Bad String " + strings[i] + " " + e.toString());
        e.printStackTrace();
        TestCase.assertTrue(false);
      }
    }
  }
  
  public void testNullString()
  {
    IclTerm t = IclTerm.fromString(true, "");
    TestCase.assertTrue(t == null);
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -