Include test vectors as a local resource
This eliminates an implicit test dependency on network connectivity
This commit is contained in:
parent
84a405197c
commit
ed523d3db3
@ -1,19 +1,14 @@
|
||||
package com.southernstorm.noise.tests;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class UnitVectorTests {
|
||||
|
||||
private static final String testVectorsCommit = "5d0a74760320e5486ced302e36ccad91606aac43";
|
||||
|
||||
@Test
|
||||
public void testBasicVector() throws Exception {
|
||||
try (InputStream stream = new URL(
|
||||
"https://raw.githubusercontent.com/rweather/noise-c/" + testVectorsCommit
|
||||
+ "/tests/vector/noise-c-basic.txt").openStream()) {
|
||||
try (final InputStream stream = getClass().getResourceAsStream("test-vectors.json")) {
|
||||
VectorTests vectorTests = new VectorTests();
|
||||
vectorTests.processInputStream(stream);
|
||||
Assert.assertEquals(vectorTests.getFailed(), 0);
|
||||
|
||||
19684
src/test/resources/com/southernstorm/noise/tests/test-vectors.json
Normal file
19684
src/test/resources/com/southernstorm/noise/tests/test-vectors.json
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user