fix(graphite): minor fix to query editor when using summarize function with no metric segments, only series ref, fixes #2788

This commit is contained in:
Torkel Ödegaard
2015-09-22 13:32:28 +02:00
parent 6f9c306260
commit b37f9a7db0
5 changed files with 39 additions and 1 deletions

View File

@@ -109,6 +109,14 @@ define([
expect(tokens[4].value).to.be('0.002');
});
it('should handle bool parameters', function() {
var lexer = new Lexer("alias(metric, true, false)");
var tokens = lexer.tokenize();
expect(tokens[4].type).to.be('bool');
expect(tokens[4].value).to.be('true');
expect(tokens[6].type).to.be('bool');
});
});
});

View File

@@ -165,6 +165,15 @@ define([
expect(rootNode.params[1].value).to.be('#B');
});
it('series parameters, issue 2788', function() {
var parser = new Parser("summarize(diffSeries(#A, #B), '10m', 'sum', false)");
var rootNode = parser.getAst();
expect(rootNode.type).to.be('function');
expect(rootNode.params[0].type).to.be('function');
expect(rootNode.params[1].value).to.be('10m');
expect(rootNode.params[3].type).to.be('bool');
});
it('should parse metric expression with ip number segments', function() {
var parser = new Parser('5.10.123.5');
var rootNode = parser.getAst();