<commit_before>import test from 'ava';
import * as graphtraversal from '../../src';

import itertools from "@aureooms/js-itertools" ;
var list = itertools.list ;

import collections from "@aureooms/js-collections" ;
var set = collections.set ;

import dll from "@aureooms/js-dll" ;
import adjacencylist from "@aureooms/js-adjacency-list" ;

var augment = require( "@aureooms/js-graph-augment" ).augment ;
import labeled from "@aureooms/js-graph-labeled" ;
import sugar from "@aureooms/js-graph-sugar" ;

var _MultiDiGraph = adjacencylist.MultiDiGraph( dll.DoublyLinkedList , Map ) ;
var MultiDiGraph = augment( _MultiDiGraph ).with( labeled.label , sugar.add_missing_vertices ) ;

var preorder = graphtraversal.dfs_preorder ;
var preorder_from_source = graphtraversal.dfs_preorder_from_source ;
var postorder = graphtraversal.dfs_postorder ;
var postorder_from_source = graphtraversal.dfs_postorder_from_source ;

test( "dfs" , function ( assert ) {

	var G = new MultiDiGraph( ) ;

	G.eadd( 1 , 2 ) ;
	G.eadd( 2 , 3 ) ;

	assert.t.truthy( set( preorder( G ) ).isequal( [ 1 , 2 , 3 ] ) , "preorder" ) ;
	assert.t.deepEqual( list( preorder_from_source( G , 2 ) ) , [ 2 , 3 ] , "preorder_from_source" ) ;
	assert.t.truthy( set( postorder( G ) ).isequal( [ 3 , 2 , 1 ] ) , "postorder" ) ;
	assert.t.deepEqual( list( postorder_from_source( G , 2 ) ) , [ 3 , 2 ] , "postorder_from_source" ) ;

} ) ;

<commit_msg>:mag: test: Make tests run.<commit_after>import test from 'ava';
import * as graphtraversal from '../../src';

import { list } from "@aureooms/js-itertools" ;

import { set } from "@aureooms/js-collections" ;

import { DoublyLinkedList } from "@aureooms/js-dll" ;
import adjacencylist from "@aureooms/js-adjacency-list" ;

import { augment } from "@aureooms/js-graph-augment" ;
import labeled from "@aureooms/js-graph-labeled" ;
import sugar from "@aureooms/js-graph-sugar" ;

const _MultiDiGraph = adjacencylist.MultiDiGraph( DoublyLinkedList , Map ) ;
const MultiDiGraph = augment( _MultiDiGraph ).with( labeled.label , sugar.add_missing_vertices ) ;

const preorder = graphtraversal.dfs_preorder ;
const preorder_from_source = graphtraversal.dfs_preorder_from_source ;
const postorder = graphtraversal.dfs_postorder ;
const postorder_from_source = graphtraversal.dfs_postorder_from_source ;

test( "dfs" , t => {

	const G = new MultiDiGraph( ) ;

	G.eadd( 1 , 2 ) ;
	G.eadd( 2 , 3 ) ;

	t.true( set( preorder( G ) ).isequal( [ 1 , 2 , 3 ] ) , "preorder" ) ;
	t.deepEqual( list( preorder_from_source( G , 2 ) ) , [ 2 , 3 ] , "preorder_from_source" ) ;
	t.true( set( postorder( G ) ).isequal( [ 3 , 2 , 1 ] ) , "postorder" ) ;
	t.deepEqual( list( postorder_from_source( G , 2 ) ) , [ 3 , 2 ] , "postorder_from_source" ) ;

} ) ;


{'fraction_non_alphanumeric': 0.1427007299270073, 'fraction_numerical': 0.01167883211678832, 'mean_word_length': 4.230916030534351, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6490085', 'n_tokens_mistral': 1079, 'n_tokens_neox': 1012, 'n_words': 228}