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

26
LINES

< > BotCompany Repo | #1035332 // test_structure_skipDefaultValues

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

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

1  
scope test_structure_skipDefaultValues
2  
3  
sclass #X {
4  
  settable int x = 1;
5  
  settable bool b = true;
6  
  settable bool c = false;
7  
  settable L l = ll(1);
8  
  settable S s;
9  
}
10  
11  
svoid testCase(S s, O o) {
12  
  new structure_Data d;
13  
  d.skipDefaultValues(true);
14  
  S x = shortClassName(X);
15  
  s = migrateClassesInStructureText(s, "X", X);
16  
  assertEqualsVerbose(s, structure(o, d));
17  
}
18  
19  
svoid test_structure_skipDefaultValues() {
20  
  testCase("X", new X());
21  
  testCase("X(b=f)", new X().b(false));
22  
  testCase("X(c=t)", new X().c(true));
23  
  testCase("X(l=null)", new X().l(null));
24  
  testCase([[X(s="hello")]], new X().s("hello"));
25  
  testCase("array{}", new O[] {});
26  
}

Author comment

Began life as a copy of #1035330

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035332
Snippet name: test_structure_skipDefaultValues
Eternal ID of this version: #1035332/9
Text MD5: 441cb209ef298386f70b8ab7ada15abd
Transpilation MD5: 1e8635ef3de30345871518a9f3cc0afc
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-05-01 17:16:53
Source code size: 672 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 148 / 244
Version history: 8 change(s)
Referenced in: [show references]