File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { Noun } from './noun' ;
2+ import { Writable } from './textHelper' ;
3+
4+ export function within ( word : Noun ) : Writable {
5+ return {
6+ write ( ) {
7+ return `in ${ word . dative ( ) . write ( ) } ` ;
8+ } ,
9+ } ;
10+ }
11+
12+ export function into ( word : Noun ) : Writable {
13+ return {
14+ write ( ) {
15+ return `in ${ word . accusative ( ) . write ( ) } ` ;
16+ } ,
17+ } ;
18+ }
19+
20+ export function to ( word : Noun ) : Writable {
21+ return {
22+ write ( ) {
23+ return `zu ${ word . dative ( ) . write ( ) } ` ;
24+ } ,
25+ } ;
26+ }
Original file line number Diff line number Diff line change 1+ import { noun } from '../src/noun' ;
2+ import { into , to , within } from '../src/utility' ;
3+
4+ test ( 'provides aliases' , ( ) => {
5+ const car = noun ( 'das Haus,häuser,-es' ) ;
6+ expect ( within ( car ) . write ( ) ) . toBe ( 'in einem Haus' ) ;
7+ expect ( within ( car . specific ( ) ) . write ( ) ) . toBe ( 'in dem Haus' ) ;
8+
9+ expect ( into ( car ) . write ( ) ) . toBe ( 'in ein Haus' ) ;
10+
11+ expect ( to ( car ) . write ( ) ) . toBe ( 'zu einem Haus' ) ;
12+ } ) ;
You can’t perform that action at this time.
0 commit comments