Uses 911K of libraries. Click here for Pure Java version (20075L/110K).
1 | !7 |
2 | |
3 | cmodule TestPhilosophyBot1 > DynPrintLog { |
4 | transient LS musingSnippets = ll(#1025734, #1025756); |
5 | |
6 | transient ReliableSingleThread rstUpdateList = dm_rstWithDelay(this, 0.5, r updateListImpl); |
7 | transient LS errors = listWithNotify(rstUpdateList); |
8 | transient JList jList; |
9 | |
10 | visual jhsplit(super, |
11 | jCenteredLiveValueSection(dm_calculatedLiveValue(S, () -> "Errors (" + l(errors) + ")"), |
12 | jList = listPopupMenuItemsThreaded(jlist(errors), |
13 | "Show text", r { showText("Test Error", selectedItem(jList)) } |
14 | ))); |
15 | |
16 | start-thread { |
17 | for (S snippetID : musingSnippets) |
18 | dm_onSnippetEdited(snippetID, r dm_reload); |
19 | |
20 | try { |
21 | new Scorer<S> scorer; // infos are print logs |
22 | errors.clear(); |
23 | scorer.errors = errors; |
24 | Var<Int> n = new(0); |
25 | |
26 | for (S snippetID : musingSnippets) { |
27 | Scorer scorer2, int n2 = unpair test_PhilosophyBot1(snippetID); |
28 | incIntVar(n, n2); |
29 | scorer.add(scorer2); |
30 | } |
31 | |
32 | // local DB |
33 | for (S musing : (LS) collect text((Cl) dm_call(dm_aiMusingsCRUD(), "concepts"))) |
34 | addTestToScorerWithPrintLog(scorer, r { |
35 | incIntVar(n, ai_checkMusing(musing)); |
36 | }); |
37 | |
38 | for (Runnable r : ll( |
39 | r test_FactStore, |
40 | r test_philosophyBot1_nativePredicateOnLHS, |
41 | r test_philosophyBot1_dropCommentParagraphs, |
42 | )) |
43 | addTestToScorerWithPrintLog(scorer, r); |
44 | |
45 | if (scorer.allCorrect()) |
46 | infoBox("PhilosophyBot1 tested OK - " + n2(n!, "expectation") + " tested / " + scorer); |
47 | else |
48 | infoBox("PhilosophyBot1 failures - " + n2(n!, "expectation") + " tested / " + scorer); |
49 | } on fail { |
50 | infoBox("PhilosophyBot1 fail"); |
51 | } |
52 | } |
53 | |
54 | void updateListImpl { |
55 | fillListWithStrings(jList, errors); |
56 | } |
57 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1025736 |
Snippet name: | Philosophy bot main test (musings, FactStore) |
Eternal ID of this version: | #1025736/25 |
Text MD5: | 28369e1c6e9de9d3cbe49e5537b419d7 |
Transpilation MD5: | c35e3fa03b0bfe68c8dd615e2ead58d7 |
Author: | stefan |
Category: | javax |
Type: | JavaX source code (Dynamic Module) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-03-20 16:11:35 |
Source code size: | 1828 bytes / 57 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 355 / 12755 |
Version history: | 24 change(s) |
Referenced in: | [show references] |