(CommandList children: [ (C {(.)} {(../string.lib.sh)}) (C {(.)} {(../bool.lib.sh)}) (FuncDef name: test_k_string_contains body: (BraceGroup children: [ (C {(assertTrue)} {(DQ ('241345 contains 1'))} {(DQ ('k_string_contains 1 241345'))}) (C {(assertTrue)} {(DQ ('d3dabcd contains a'))} {(DQ ('k_string_contains a d3dabcd'))}) (C {(assertTrue)} {(DQ ('-- contains -'))} {(DQ ('k_string_contains - --'))}) (C {(assertFalse)} {(DQ ('acd does not contain b'))} {(DQ ('k_string_contains b acd'))}) ] spids: [17] ) spids: [13 16] ) (FuncDef name: test_k_string_get_line body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:line1) op: Equal rhs: {(DQ ('Hello world!'))} spids: [77] ) ] spids: [75] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:line2) op: Equal rhs: {(DQ ('This is some text'))} spids: [85] ) ] spids: [83] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:line3) op: Equal rhs: {(DQ ('And this is more'))} spids: [93] ) ] spids: [91] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:str) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(printf)} {(DQ ('%s') (Lit_Other '\\') ('n%s') (Lit_Other '\\') ('n%s'))} {(DQ (${ VSub_Name line1))} {(DQ (${ VSub_Name line2))} {(DQ (${ VSub_Name line3))} ) ] ) left_token: <Left_CommandSub '$('> spids: [103 131] ) ) } spids: [101] ) ] spids: [99] ) (C {(assertEquals)} {(DQ (${ VSub_Name line1))} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(k_string_get_line)} {(1)} {(DQ (${ VSub_Name str))})] ) left_token: <Left_CommandSub '$('> spids: [145 155] ) ) } ) (C {(assertEquals)} {(DQ (${ VSub_Name line2))} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(k_string_get_line)} {(2)} {(DQ (${ VSub_Name str))})] ) left_token: <Left_CommandSub '$('> spids: [168 178] ) ) } ) (C {(assertEquals)} {(DQ (${ VSub_Name line3))} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(k_string_get_line)} {(3)} {(DQ (${ VSub_Name str))})] ) left_token: <Left_CommandSub '$('> spids: [191 201] ) ) } ) ] spids: [72] ) spids: [68 71] ) (FuncDef name: test_k_string_ends_with body: (BraceGroup children: [ (C {(assertTrue)} {(DQ ('12345 ends with 5'))} {(DQ ('k_string_ends_with 5 12345'))}) (C {(assertFalse)} {(DQ ('12345 does not end with 6'))} {(DQ ('k_string_ends_with 6 12345'))}) (C {(assertTrue)} {(DQ ('abcd ends with d'))} {(DQ ('k_string_ends_with d abcd'))}) (C {(assertTrue)} {(DQ ('-- ends with -'))} {(DQ ('k_string_ends_with - --'))}) (C {(assertFalse)} {(DQ ('- does not end with --'))} {(DQ ('k_string_ends_with -- -'))}) (C {(assertFalse)} {(DQ ('abcd does not end with b'))} {(DQ ('k_string_ends_with b abcd'))}) ] spids: [211] ) spids: [207 210] ) (FuncDef name: test_k_string_starts_with body: (BraceGroup children: [ (C {(assertTrue)} {(DQ ('12345 starts with 1'))} {(DQ ('k_string_starts_with 1 12345'))}) (C {(assertTrue)} {(DQ ('abcd starts with a'))} {(DQ ('k_string_starts_with a abcd'))}) (C {(assertTrue)} {(DQ ('-- starts with -'))} {(DQ ('k_string_starts_with - --'))}) (C {(assertFalse)} {(DQ ('- does not start with --'))} {(DQ ('k_string_starts_with -- -'))}) (C {(assertFalse)} {(DQ ('abcd does not start with b'))} {(DQ ('k_string_starts_with b abcd'))} ) ] spids: [291] ) spids: [287 290] ) (FuncDef name: test_k_string_lower body: (BraceGroup children: [ (C {(assertEquals)} {(DQ ('ABC to lower'))} {(abc)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(k_string_lower)} {(ABC)})]) left_token: <Left_CommandSub '$('> spids: [370 374] ) ) } ) (C {(assertEquals)} {(DQ ('Abc to lower'))} {(abc)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(k_string_lower)} {(Abc)})]) left_token: <Left_CommandSub '$('> spids: [387 391] ) ) } ) (C {(assertEquals)} {(DQ ('123 to lower'))} {(123)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(k_string_lower)} {(123)})]) left_token: <Left_CommandSub '$('> spids: [404 408] ) ) } ) (C {(assertEquals)} {(DQ ('D-e+F to lower'))} {(d-e) (Lit_Other '+') (f)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(k_string_lower)} {(D-e) (Lit_Other '+') (F)})] ) left_token: <Left_CommandSub '$('> spids: [423 429] ) ) } ) ] spids: [358] ) spids: [354 357] ) (FuncDef name: test_k_string_upper body: (BraceGroup children: [ (C {(assertEquals)} {(DQ ('abc to upper'))} {(ABC)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(k_string_upper)} {(abc)})]) left_token: <Left_CommandSub '$('> spids: [451 455] ) ) } ) (C {(assertEquals)} {(DQ ('Abc to upper'))} {(ABC)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(k_string_upper)} {(Abc)})]) left_token: <Left_CommandSub '$('> spids: [468 472] ) ) } ) (C {(assertEquals)} {(DQ ('123 to upper'))} {(123)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(k_string_upper)} {(123)})]) left_token: <Left_CommandSub '$('> spids: [485 489] ) ) } ) (C {(assertEquals)} {(DQ ('D-e+F to upper'))} {(D-E) (Lit_Other '+') (F)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(k_string_upper)} {(D-e) (Lit_Other '+') (F)})] ) left_token: <Left_CommandSub '$('> spids: [504 510] ) ) } ) ] spids: [439] ) spids: [435 438] ) (FuncDef name: test_k_string_pad_right body: (BraceGroup children: [ (C {(assertEquals)} {(DQ ('Pad to 8 spaces'))} {(DQ ('foo '))} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(k_string_pad_right)} {(8)} {(foo)})]) left_token: <Left_CommandSub '$('> spids: [534 540] ) ) } ) ] spids: [520] ) spids: [516 519] ) (FuncDef name: test_k_string_pad_left body: (BraceGroup children: [ (C {(assertEquals)} {(DQ ('Pad to 8 spaces'))} {(DQ (' foo'))} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(k_string_pad_left)} {(8)} {(foo)})]) left_token: <Left_CommandSub '$('> spids: [564 570] ) ) } ) ] spids: [550] ) spids: [546 549] ) (FuncDef name: test_k_string_remove_start body: (BraceGroup children: [ (C {(assertEquals)} {(DQ ('abc remove a from start'))} {(bc)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(k_string_remove_start)} {(a)} {(abc)})] ) left_token: <Left_CommandSub '$('> spids: [592 598] ) ) } ) (C {(assertEquals)} {(DQ ('aabc remove a from start'))} {(abc)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(k_string_remove_start)} {(a)} {(aabc)})] ) left_token: <Left_CommandSub '$('> spids: [611 617] ) ) } ) (C {(assertEquals)} {(DQ ('abc remove b from start'))} {(abc)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(k_string_remove_start)} {(b)} {(abc)})] ) left_token: <Left_CommandSub '$('> spids: [630 636] ) ) } ) (C {(assertEquals)} {(DQ ('abc remove c from start'))} {(abc)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(k_string_remove_start)} {(c)} {(abc)})] ) left_token: <Left_CommandSub '$('> spids: [649 655] ) ) } ) (C {(assertEquals)} {(DQ ('abc remove d from start'))} {(abc)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(k_string_remove_start)} {(d)} {(abc)})] ) left_token: <Left_CommandSub '$('> spids: [668 674] ) ) } ) ] spids: [580] ) spids: [576 579] ) (FuncDef name: test_k_string_remove_end body: (BraceGroup children: [ (C {(assertEquals)} {(DQ ('abc remove a from end'))} {(abc)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(k_string_remove_end)} {(a)} {(abc)})]) left_token: <Left_CommandSub '$('> spids: [696 702] ) ) } ) (C {(assertEquals)} {(DQ ('abc remove b from end'))} {(abc)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(k_string_remove_end)} {(b)} {(abc)})]) left_token: <Left_CommandSub '$('> spids: [715 721] ) ) } ) (C {(assertEquals)} {(DQ ('abc remove c from end'))} {(ab)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(k_string_remove_end)} {(c)} {(abc)})]) left_token: <Left_CommandSub '$('> spids: [734 740] ) ) } ) (C {(assertEquals)} {(DQ ('abc remove d from end'))} {(abc)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(k_string_remove_end)} {(d)} {(abc)})]) left_token: <Left_CommandSub '$('> spids: [753 759] ) ) } ) ] spids: [684] ) spids: [680 683] ) (FuncDef name: test_k_string_join body: (BraceGroup children: [ (C {(assertEquals)} {(DQ ('a joined by hyphen'))} {(DQ (a))} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(k_string_join)} {(DQ (-))} {(a)})]) left_token: <Left_CommandSub '$('> spids: [783 791] ) ) } ) (C {(assertEquals)} {(DQ ('a, b joined by hyphen'))} {(DQ (a-b))} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(k_string_join)} {(DQ (-))} {(a)} {(b)})] ) left_token: <Left_CommandSub '$('> spids: [806 816] ) ) } ) (C {(assertEquals)} {(DQ ('a, b, c joined by hyphen'))} {(DQ (a-b-c))} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(k_string_join)} {(DQ (-))} {(a)} {(b)} {(c)})] ) left_token: <Left_CommandSub '$('> spids: [831 843] ) ) } ) (C {(assertEquals)} {(DQ ('a, b, c joined by nothing'))} {(DQ (abc))} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(k_string_join)} {(DQ )} {(a)} {(b)} {(c)})] ) left_token: <Left_CommandSub '$('> spids: [858 869] ) ) } ) ] spids: [769] ) spids: [765 768] ) (FuncDef name: test_k_string_trim body: (BraceGroup children: [ (C {(assertEquals)} {(DQ ("' a' trimmed"))} {(DQ (a))} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(k_string_trim)} {(DQ (' a'))})]) left_token: <Left_CommandSub '$('> spids: [893 899] ) ) } ) (C {(assertEquals)} {(DQ ("'a\t' trimmed"))} {(DQ (a))} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(k_string_trim)} {(DQ ('a\t'))})]) left_token: <Left_CommandSub '$('> spids: [914 920] ) ) } ) (C {(assertEquals)} {(DQ ("' a ' trimmed"))} {(DQ (a))} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(k_string_trim)} {(DQ (' a '))})]) left_token: <Left_CommandSub '$('> spids: [935 941] ) ) } ) (C {(assertEquals)} {(DQ ("' a b c\t' trimmed"))} {(DQ ('a b c'))} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(k_string_trim)} {(DQ (' a b c\t'))})] ) left_token: <Left_CommandSub '$('> spids: [956 962] ) ) } ) ] spids: [879] ) spids: [875 878] ) ] )