package org.apache.couchdb.lucene;

import static org.junit.Assert.assertThat;

import org.hamcrest.CoreMatchers;
import org.junit.Test;

public class RhinoTest {

	@Test
	public void testRhino() throws Exception {
		final Rhino rhino = new Rhino("function(doc) { delete doc.deleteme; return doc; }");
		final String doc = "{\"deleteme\":\"true\", \"size\":13}";
		assertThat(rhino.parse(doc), CoreMatchers.equalTo("{\"size\":13}"));
		rhino.close();
	}

}

@@ -277,16 +277,28 @@
 eleteme;
+ doc.size++;
  return 
@@ -432,17 +432,17 @@
 size%5C%22:1
-3
+4
 %7D%22));%0A%09%09

enhance test to show we can edit attributes in the filter.