Skip to content

Commit

Permalink
unit test to ensure grouping doesnt break
Browse files Browse the repository at this point in the history
  • Loading branch information
madhephaestus committed Jul 30, 2024
1 parent e8bc0bd commit 92f2826
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/test/java/eu/mihosoft/vrl/v3d/GroupingTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package eu.mihosoft.vrl.v3d;

import static org.junit.Assert.*;

import org.junit.Test;

public class GroupingTest {

@Test
public void test() {
CSG c = new Cube(100).toCSG();
String groupID = "testing";
c.addGroupMembership(groupID);
c.setName("MyName");
c.addIsGroupResult(groupID);
CSG copy = c.clone().syncProperties(c).setName(c.getName());
copy.removeGroupMembership(groupID);
copy.removeIsGroupResult(groupID);

if(copy.isInGroup())
fail("Copy should not be in a group");
if(!c.isInGroup())
fail("Original should be in a group");

if(copy.isGroupResult())
fail("Copy should not be in a group");
if(!c.isGroupResult())
fail("Original should be in a group");

}

}

0 comments on commit 92f2826

Please sign in to comment.