Skip to content
Browse files

assert date is converted to value correctly

  • Loading branch information...
1 parent 81ea4c1 commit e0937357b91c6f3ea9bc82c21a705ad1afa22b0a Robert Newson committed Aug 13, 2010
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/test/java/com/github/rnewson/couchdb/lucene/DocumentConverterTest.java
View
3 src/test/java/com/github/rnewson/couchdb/lucene/DocumentConverterTest.java
@@ -218,14 +218,15 @@ public void testDateString() throws Exception {
@Test
public void testDateObject() throws Exception {
- final String fun = "function(doc) { var ret=new Document(); ret.add(new Date(), {type:\"date\", field:\"num\"}); return ret; }";
+ final String fun = "function(doc) { var ret=new Document(); ret.add(new Date(2010,8,13), {type:\"date\", field:\"num\"}); return ret; }";
final DocumentConverter converter = new DocumentConverter(context, view(fun));
final Document[] result = converter.convert(
doc("{_id:\"hi\"}"),
settings(),
null);
assertThat(result.length, is(1));
assertThat(result[0].getFieldable("num"), is(NumericField.class));
+ assertThat((Long)((NumericField)result[0].getFieldable("num")).getNumericValue(), is(1284332400000L));
}
@Test

0 comments on commit e093735

Please sign in to comment.
Something went wrong with that request. Please try again.