{"size": 895, "ext": "js", "max_stars_repo_path": "test/language/en/repeating.test.js", "max_stars_repo_name": "elyndon/ecolect-js", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "test/language/en/repeating.test.js", "max_issues_repo_name": "elyndon/ecolect-js", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "test/language/en/repeating.test.js", "max_forks_repo_name": "elyndon/ecolect-js", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 19.0425531915, "max_line_length": 54, "alphanum_fraction": 0.538547486}
import en from '../../../src/language/en';
import { testRunner } from '../helpers';
import GraphBuilder from '../../../src/graph/builder';

const phrase = new GraphBuilder(en)
	.name('phrase')

	.allowPartial()

	.add('Hello', () => 1)
	.add('World', () => 2)

	.toMatcher();

const test = testRunner(en.repeating(phrase)
	.onlyBest()
	.toMatcher()
);

describe('English', function() {

	describe('Repeating', function() {
		test('Hello', {}, [ 1 ]);

		test('World', {}, [ 2 ]);

		test('Hello and World', {}, [ 1, 2 ]);

		test('Hello World', {}, [ 1, 2 ]);

		test('World, Hello', {}, [ 2, 1 ]);

		test('Hello and World Hello', {}, [ 1, 2, 1 ]);

		test('Hel', { partial: false }, null);

		test('Hel', { partial: true }, [ 1 ]);

		test('Hello Wo', { partial: true }, [ 1, 2 ]);

		test('Hello and Wo', { partial: true }, [ 1, 2 ]);

		test('He and Wo', { partial: true }, null);
	});

});
