Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

9
LINES

< > BotCompany Repo | #1035785 // test_CutListToBudget (OK)

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (9785L/54K).

svoid test_CutListToBudget() {
  var cutter = new CutListToBudget<S>(s -> (double) l(s));
  cutter.allowPartial((s, l) -> takeFirst(s, iround(l)));
  cutter.maxPrice(3);
  cutter.inputList(ll("aaaaa"));
  assertEqualsVerbose(ll("aaa"), cutter!);
  assertEqualsVerbose("aaaaa", cutter.fullLastElement());
  assertEqualsVerbose(Percent.fromRatio(3.0/5.0), cutter.lastElementKeptPercentage());
}

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): elmgxqgtpvxh, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035785
Snippet name: test_CutListToBudget (OK)
Eternal ID of this version: #1035785/6
Text MD5: f49702ee88d5af3a643f41ffaac8c634
Transpilation MD5: 27de717f617e074d6c95c8fb291c1c40
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-07-25 15:59:35
Source code size: 400 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 133 / 208
Version history: 5 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)