Browse Source

[spod] Test SPOD nullable SEnum and SData. Closes #1849

Cauê Waneck 11 years ago
parent
commit
6ecaf28d9c
2 changed files with 10 additions and 0 deletions
  1. 1 0
      tests/unit/MySpodClass.hx
  2. 9 0
      tests/unit/TestSpod.hx

+ 1 - 0
tests/unit/MySpodClass.hx

@@ -29,6 +29,7 @@ import sys.db.Types;
   @:relation(rnid) public var relationNullable:Null<OtherSpodClass>;
   public var data:Null<SData<Array<ComplexClass>>>;
 	public var abstractType:Null<AbstractSpodTest<String>>;
+	public var anEnum:Null<SEnum<SpodEnum>>;
 }
 
 @:keep class ComplexClass

+ 9 - 0
tests/unit/TestSpod.hx

@@ -86,6 +86,10 @@ class TestSpod extends Test
 		Manager.cleanup();
 		scls = NullableSpodClass.manager.get(id);
 		eq( untyped NullableSpodClass.manager.getUpdateStatement( scls ), null );
+		eq(scls.data,null);
+		eq(scls.relationNullable,null);
+		eq(scls.abstractType,null);
+		eq(scls.anEnum,null);
 		scls.delete();
 
 		//same thing with explicit null set
@@ -93,6 +97,7 @@ class TestSpod extends Test
 		scls.data = null;
 		scls.relationNullable = null;
 		scls.abstractType = null;
+		scls.anEnum = null;
 		scls.insert();
 
 		var id = scls.theId;
@@ -102,6 +107,10 @@ class TestSpod extends Test
 		Manager.cleanup();
 		scls = NullableSpodClass.manager.get(id);
 		eq( untyped NullableSpodClass.manager.getUpdateStatement( scls ), null );
+		eq(scls.data,null);
+		eq(scls.relationNullable,null);
+		eq(scls.abstractType,null);
+		eq(scls.anEnum,null);
 		scls.delete();
 
 	}