Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增加calculate-expression类型 #13

Merged
merged 2 commits into from
Sep 20, 2024
Merged

增加calculate-expression类型 #13

merged 2 commits into from
Sep 20, 2024

Conversation

aoyaZY
Copy link
Contributor

@aoyaZY aoyaZY commented Aug 13, 2024

增加calculate-expression类型,可以满足属性字段的单次加减乘除运算。本次提交包含处理代码和测试用例

index.js Outdated
@@ -258,7 +333,7 @@ export function loadFunctionTypes(obj, argFn) {
}
return hit ? multResult : obj;
}
var result = { '__fn_types_loaded': true },
var result = { fnTypesLoaded: true },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个属性名因为别的地方也会引用,不能随便修改

index.js Outdated
const targetVariable = String(parameters.property);
const expression = parameters.expression;
const newValue = input;
console.log('input', input);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要去掉代码里的console.log

test.js Outdated
expect(rgbatoStr(result.markerFill)).to.be(rgbatoStr([0.21176470588235294, 0.21176470588235294, 0.21176470588235294, 1]));
});
});
const expect = require('expect.js');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原来的测试用例不应删除,需要还原回来,用例的分类可以这样处理:

  • describe方法里的测试集名称,改为概括性的 specs
  • mocha的context方法增加一个子分类 color-interpolate,把原有用例挪到该分类下
  • 同样用context方法增加子类 calculate-expression,把新的用例放到该分类下

@fuzhenn fuzhenn merged commit b52cd25 into maptalks:master Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants