mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-27 00:03:50 +00:00
test(evals): measure Java code intelligence as the user sees it (#2758)
pnpm eval drives the production workbench in Chromium against a release openidea-server and real jdtls, judging each scenario (navigation, usages, implementations, gutter markers, lenses, diagnostics, completion, docs, rename) on time to feedback, first and complete result, and checking results against evals/java/golden/. Supporting changes: data-* hooks in the usages popup, hints and rows; a shared in-page Tauri shim for smoke tests and evals; a shared perf bundle builder; language-server versions in .github/tool-versions.env shared with Language smoke; the eval agent skill.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package com.example.orders;
|
||||
|
||||
/** Takes a percentage off orders of at least {@code minQuantity} items. */
|
||||
public class BulkDiscount extends ListPrice {
|
||||
private final int minQuantity;
|
||||
private final int percent;
|
||||
|
||||
public BulkDiscount(int minQuantity, int percent) {
|
||||
this.minQuantity = minQuantity;
|
||||
this.percent = percent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long price(Order order) {
|
||||
long list = super.price(order);
|
||||
return order.quantity() >= minQuantity ? list * (100 - percent) / 100 : list;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.example.orders;
|
||||
|
||||
/** Charges the order's total. */
|
||||
public class ListPrice implements PricingRule {
|
||||
@Override
|
||||
public long price(Order order) {
|
||||
return order.totalCents();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.example.orders;
|
||||
|
||||
/** Turns an order into the price charged for it, in cents. */
|
||||
public interface PricingRule {
|
||||
long price(Order order);
|
||||
}
|
||||
Reference in New Issue
Block a user