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

21
LINES

< > BotCompany Repo | #1003923 // Test testBracketHygiene

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (968L/7K/24K).

!752

p {
  test("{[(a)]}", true); // ok
  test("[(a)"); // not closed
  test("a)"); // not opened
  test("(a)}"); // not opened
  test("(a]"); // mismatch
  print("\nALL TESTS OK");
}

static void test(S s) {
  test(s, false);
}

static void test(S s, bool ok) {
  new Var<S> msg;
  assertEquals(s, ok, testBracketHygiene(s, msg));
  print(msg.get());
  print("ok");
}

Author comment

Began life as a copy of #1003920

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1003923
Snippet name: Test testBracketHygiene
Eternal ID of this version: #1003923/1
Text MD5: d01d7ffad74ebc178d5bc6f018953215
Transpilation MD5: 83deb8bd0cddc016975d7506df4b2b29
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-07-30 18:36:34
Source code size: 389 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 558 / 645
Referenced in: [show references]