summaryrefslogtreecommitdiff
path: root/src/test/java/bjc/inflexion/InflectionMLTest.java
blob: 8c44881d7c590b54efdde28a41dcab05206c1468 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package bjc.inflexion;

import org.junit.Test;

import static org.junit.Assert.*;

import static bjc.inflexion.InflectionML.inflect;

public class InflectionMLTest {
	@Test
	public void testML() {
		assertEquals("no results", inflect("<#n:0> <N:results>"));
		assertEquals("7 results",  inflect("<#n:7> <N:results>"));

		// FIXME
		//
		// Adjust this to use <V> for were/was when it is implemented
		assertEquals("no items were found", inflect("<#n:0> <N:item> were found"));
		assertEquals("no item was found", inflect("<#s:0> <N:item> was found"));

		assertEquals("a result", inflect("<#a:1> <N:results>"));
		assertEquals("3 results", inflect("<#a:3> <N:results>"));

		assertEquals("an outcome", inflect("<#a:1> <N:outcomes>"));
		assertEquals("3 outcomes", inflect("<#a:3> <N:outcomes>"));

		assertEquals("5 things", inflect("<#a:5> <Noun:things>"));
		assertEquals("a thing", inflect("<#An:1> <Noun:things>"));
	}
}