mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
25 lines
866 B
JavaScript
25 lines
866 B
JavaScript
'use strict';
|
|
require('./patch-module');
|
|
|
|
var chai = require('chai');
|
|
chai.config.includeStack = true;
|
|
var path = require('path');
|
|
var adjustIndent = require('../compiler/util/adjustIndent');
|
|
var autotest = require('./autotest');
|
|
var fs = require('fs');
|
|
|
|
describe('compiler/util/adjustIndent', function() {
|
|
var autoTestDir = path.join(__dirname, 'autotests/adjustIndent');
|
|
|
|
autotest.scanDir(
|
|
autoTestDir,
|
|
function run(dir, helpers, done) {
|
|
var inputPath = path.join(dir, 'input.txt');
|
|
var testSettings = require(path.join(dir, 'test.js'));
|
|
var input = fs.readFileSync(inputPath, { encoding: 'utf8' });
|
|
var newIndentation = testSettings.newIndentation;
|
|
var output = adjustIndent(input, newIndentation);
|
|
helpers.compare(output, '.txt');
|
|
done();
|
|
});
|
|
}); |