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

📄 testcreate_set.java

📁 JAVA 数学程序库 提供常规的数值计算程序包
💻 JAVA
字号:
package jmathlibtests.toolbox.set;

import jmathlib.core.interpreter.Interpreter;
import jmathlib.tools.junit.framework.*;
import jmathlibtests.Compare;

public class testCreate_set extends TestCase {
	protected Interpreter ml;
	
    public testCreate_set(String name) {
		super(name);
	}
	public static void main (String[] args) {
		jmathlib.tools.junit.textui.TestRunner.run (suite());
	}
	protected void setUp() {
		ml = new Interpreter(true);
	}

	public static Test suite() {
		return new TestSuite(testCreate_set.class);
	}

    
	public void testCreate_set01() {
        double[][] a = { {2.0, 3.0, 5.0, 6.0}};
        ml.executeExpression("a = create_set([2,3;5,6])");
        assertTrue(Compare.ArrayEquals(a, ml.getArrayValueRe("a")));
	}

    public void testCreate_set02() {
        double[][] a = {{1.0, 8.0}};
        ml.executeExpression("a = create_set([8,1,1,1])");
        assertTrue(Compare.ArrayEquals(a, ml.getArrayValueRe("a")));
    }

    public void testCreate_set10() {
        double[][] a = {{1.0, 2.0, 3.0, 4.0, 5.0, 8.0, 9.0}};
        ml.executeExpression("a = create_set([8,1,1; 3,5,3; 2,9,4; 2,3,4])");
        assertTrue(Compare.ArrayEquals(a, ml.getArrayValueRe("a")));
    }

 
}

⌨️ 快捷键说明

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