<commit_before>//the goal of this test script is not to test the detailed semantics of SCION (this is what scxml-test-framework is for),
//but instead is to provide test coverage of the unified API exposed by rhino, node and browser versions of SCION
//assume we have an http fileserver running in this directory on port 8888, and can require scion

var scion = require('scion');


//basic0 test
var s = 
'<?xml version="1.0" encoding="UTF-8"?>\n' + 
'<scxml \n' + 
'	xmlns="http://www.w3.org/2005/07/scxml"\n' + 
'	version="1.0"\n' + 
'	profile="ecmascript"\n' + 
'	id="root"\n' + 
'	initial="a">\n' + 
'	<state id="a"/>\n' + 
'</scxml>';

var tests = [
    function(){
        scion.pathToModel('./scxml-test-framework/test/basic/basic0.scxml',function(err,model){
            go(model);
        });
    },
    function(){
        scion.urlToModel('http://localhost:8888/scxml-test-framework/test/basic/basic0.scxml',function(err,model){
            go(model);
        });
    },
    function(){
        go(scion.documentStringToModel(s));
    },
    function(){
        go(scion.documentToModel(scion.parseDocumentString(s)));
    }
];




function go(model){
    var scxml = new scion.SCXML(model);
    var conf = scxml.start(); 
    if(!( conf && conf[0] === 'a' )) throw new Error('assertion failed');
}

tests.forEach(function(fn){fn();});

//for rhino to finish:
if(typeof quit !== 'undefined'){
    quit(0);
}
<commit_msg>Updated surface-test.js to remove unsupported API.<commit_after>//the goal of this test script is not to test the detailed semantics of SCION (this is what scxml-test-framework is for),
//but instead is to provide test coverage of the unified API exposed by rhino, node and browser versions of SCION
//assume we have an http fileserver running in this directory on port 8888, and can require scion

var scion = require('scion');


//basic0 test
var s = 
'<?xml version="1.0" encoding="UTF-8"?>\n' + 
'<scxml \n' + 
'	xmlns="http://www.w3.org/2005/07/scxml"\n' + 
'	version="1.0"\n' + 
'	profile="ecmascript"\n' + 
'	id="root"\n' + 
'	initial="a">\n' + 
'	<state id="a"/>\n' + 
'</scxml>';

var tests = [
    function(){
        scion.pathToModel('./scxml-test-framework/test/basic/basic0.scxml',function(err,model){
            go(model);
        });
    },
    function(){
        scion.urlToModel('http://localhost:8888/scxml-test-framework/test/basic/basic0.scxml',function(err,model){
            go(model);
        });
    },
    function(){
        scion.documentStringToModel(s,function(err,model){
            go(model);
        });
    }
];

function go(model){
    var scxml = new scion.SCXML(model);
    var conf = scxml.start(); 
    if(!( conf && conf[0] === 'a' )) throw new Error('assertion failed');
}

tests.forEach(function(fn){fn();});

{'fraction_non_alphanumeric': 0.17480258435032303, 'fraction_numerical': 0.017587939698492462, 'mean_word_length': 3.0865102639296187, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 2, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 24}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3266332', 'n_tokens_mistral': 989, 'n_tokens_neox': 954, 'n_words': 228}