''';
var buf = new CodeBuffer();
var document = jael.parseDocument(template, sourceUrl: 'test.jl');
var scope = new SymbolTable();
const jael.Renderer().render(document, buf, scope);
print(buf);
expect(
buf.toString(),
'''
''';
var buf = new CodeBuffer();
var document = jael.parseDocument(template, sourceUrl: 'test.jl');
var scope = new SymbolTable();
const jael.Renderer().render(document, buf, scope);
print(buf);
expect(
buf.toString(),
'''
'''
.trim());
});
test('quoted attribute name', () {
const template = '''
''';
var buf = new CodeBuffer();
var document = jael.parseDocument(template, sourceUrl: 'test.jl');
var scope = new SymbolTable();
const jael.Renderer().render(document, buf, scope);
print(buf);
expect(
buf.toString(),
'''
'''
.trim());
});
test('switch', () {
const template = '''
BAN HAMMER LOLOL
You are in good standing.
Weird...
''';
var buf = new CodeBuffer();
var document = jael.parseDocument(template, sourceUrl: 'test.jl');
var scope = new SymbolTable(values: {
'account': new _Account(isDisabled: true),
});
const jael.Renderer().render(document, buf, scope);
print(buf);
expect(buf.toString().trim(), 'BAN HAMMER LOLOL');
});
test('default', () {
const template = '''
BAN HAMMER LOLOL
You are in good standing.
Weird...
''';
var buf = new CodeBuffer();
var document = jael.parseDocument(template, sourceUrl: 'test.jl');
var scope = new SymbolTable(values: {
'account': new _Account(isDisabled: null),
});
const jael.Renderer().render(document, buf, scope);
print(buf);
expect(buf.toString().trim(), 'Weird...');
});
}
const List<_Pokemon> starters = const [
const _Pokemon('Bulbasaur', 'Grass'),
const _Pokemon('Charmander', 'Fire'),
const _Pokemon('Squirtle', 'Water'),
];
class _Pokemon {
final String name, type;
const _Pokemon(this.name, this.type);
}
class _Account {
final bool isDisabled;
_Account({this.isDisabled});
}