dccf872005-03-28Martin Nilsson START_MARKER define(test_pike_token,[[
14e8c02005-04-08Martin Nilsson test_equal(Parser.Pike.low_split($1),({$1}))
dccf872005-03-28Martin Nilsson ]]) test_equal(Parser.Pike.low_split(""),({})) test_pike_token("// 256 tokens") test_pike_token("#\"\"")
78e43b2005-03-29Martin Nilsson test_pike_token("# \"\"")
dccf872005-03-28Martin Nilsson test_pike_token("#\"\\\"\"") test_pike_token("#\"\\\\\"") test_pike_token("#\" \"") test_pike_token("#string\"\"")
78e43b2005-03-29Martin Nilsson test_pike_token("# string\"\"") test_pike_token("# string \"\"")
dccf872005-03-28Martin Nilsson test_pike_token("#string\" \"")
78e43b2005-03-29Martin Nilsson test_pike_token("#string<>") test_pike_token("# string<>") test_pike_token("# string <>") test_pike_token("# string < >")
dccf872005-03-28Martin Nilsson test_pike_token("#cpp statement") test_pike_token("#cpp\\\nstatement") test_pike_token("aaA0Ä_") test_pike_token("AaA0Ä_") test_pike_token("ÄaA0Ä_") test_pike_token("_aA0Ä_") test_pike_token(".") test_pike_token("..") test_pike_token("...") test_pike_token("0") test_pike_token("0x0") test_pike_token("0x0aA") test_pike_token("0X0") test_pike_token("0X0aA") test_pike_token("0b0") test_pike_token("0b01") test_pike_token("0B0") test_pike_token("0B01") test_pike_token("001234567") test_pike_token("1234567890") test_pike_token("1.0123456789") test_pike_token("1.0123456789E0123456789") test_pike_token("1.0123456789e0123456789") test_pike_token("1.0123456789E+0123456789") test_pike_token("1.0123456789e+0123456789") test_pike_token("1.0123456789E-0123456789") test_pike_token("1.0123456789e-0123456789") test_pike_token("1E0123456789") test_pike_token("1e0123456789") test_pike_token("1E+0123456789") test_pike_token("1e+0123456789") test_pike_token("1E-0123456789") test_pike_token("1e-0123456789") test_pike_token("/") test_pike_token("`/") test_pike_token("``/") test_pike_token("/=") test_pike_token("%") test_pike_token("`%") test_pike_token("``%") test_pike_token("%=") test_pike_token("*") test_pike_token("`*") test_pike_token("``*") test_pike_token("*=") test_pike_token("&") test_pike_token("&&") test_pike_token("`&") test_pike_token("``&") test_pike_token("&=") test_pike_token("|") test_pike_token("||") test_pike_token("`|") test_pike_token("``|") test_pike_token("|=") test_pike_token("^") test_pike_token("`^") test_pike_token("``^") test_pike_token("^=") test_pike_token("~") test_pike_token("`~") test_pike_token("+") test_pike_token("++") test_pike_token("`+") test_pike_token("``+") test_pike_token("+=") test_pike_token("`+=") test_pike_token("-") test_pike_token("--") test_pike_token("`-") test_pike_token("``-") test_pike_token("-=") test_pike_token("<<=") test_pike_token("<<") test_pike_token("`<<") test_pike_token("``<<") test_pike_token("<=") test_pike_token("<") test_pike_token("`<") test_pike_token(">>=") test_pike_token(">>") test_pike_token("`>>") test_pike_token("``>>") test_pike_token(">=") test_pike_token(">") test_pike_token("`>") test_pike_token("!=") test_pike_token("!") test_pike_token("`!") test_pike_token("==") test_pike_token("`==") test_pike_token("=") test_pike_token("`()") test_pike_token("->=") test_pike_token("`->=") test_pike_token("->") test_pike_token("`->") test_pike_token("`[]") test_pike_token("`[]=") test_pike_token("`[..]") test_pike_token("{") test_pike_token("}") test_pike_token("[") test_pike_token("]") test_pike_token("\50") test_pike_token("\51") test_pike_token(";") test_pike_token("\54") test_pike_token("?") test_pike_token(":") test_pike_token("::") test_pike_token("@") test_pike_token("/**/") test_pike_token("/***/") test_pike_token("/* ** **/") test_pike_token("' '") test_pike_token("'\\''") test_pike_token("'\\ '") test_pike_token("\"\"") test_pike_token("\" \"") test_pike_token("\"\\\"\"")
e2e9642005-04-10Martin Nilsson  test_equal( Parser.Pike.split("\n// x\n"), ({ "\n", "// x", "\n\n" }) ) test_equal( Parser.Pike.split("\n// x"), ({ "\n", "// x", "\n" }) )
2ad5d92009-02-28Martin Stjernholm test_equal([[ Parser.Tabular(#"\ 1234563,\"20081128\",\"IC\",00000,8689839,\"KN: ARNL-1034758710-\",\"\",19.90,\"A\",\"M\",\"BETREFT:25399280 ACCESS INTERNET BV\",\"EUR\" 2348165,\"20081128\",\"DV\",00000,0,\"DEBETRENTE GIROKWARTAALKREDIET\",\"\",10.04,\"A\",\"M\",\"PER. 21/10-20/11 (1,15% PER MND)\",\"EUR\" 2341864,\"20081128\",\"DV\",00000,0,\"DEBETRENTE 1,39% PER MAAND,\",\"\",0.35,\"A\",\"M\",\"PERIODE 21/10 - 20/11\",\"EUR\" ", #"\ [Tabular description begin] csv :gtz ::mybankno [,] ::transferdate [,] ::mutatiesoort [,] ::volgnummer [,] ::bankno [,] ::name [,] ::kostenplaats [,] drop ::amount [,] ::afbij [,] ::mutatie [,] ::reference [,] ::valutacode [,] [Tabular description end] ")->fetch()]], [[ ([ "csv": ([ "gtz": ({ ([ "afbij": "A", "amount": "19.90", "bankno": "8689839", "mutatie": "M", "mutatiesoort": "IC", "mybankno": "1234563", "name": "KN: ARNL-1034758710-", "reference": "BETREFT:25399280 ACCESS INTERNET BV", "transferdate": "20081128", "valutacode": "EUR", "volgnummer": "00000" ]), ([ "afbij": "A", "amount": "10.04", "bankno": "0", "mutatie": "M", "mutatiesoort": "DV", "mybankno": "2348165", "name": "DEBETRENTE GIROKWARTAALKREDIET", "reference": "PER. 21/10-20/11 (1,15% PER MND)", "transferdate": "20081128", "valutacode": "EUR", "volgnummer": "00000" ]), ([ "afbij": "A", "amount": "0.35", "bankno": "0", "mutatie": "M", "mutatiesoort": "DV", "mybankno": "2341864", "name": "DEBETRENTE 1,39% PER MAAND,", "reference": "PERIODE 21/10 - 20/11", "transferdate": "20081128", "valutacode": "EUR", "volgnummer": "00000" ]) }) ]), ]) ]]) test_equal([[ Parser.Tabular(#"\ 0000 01PSTBNL21XXXX00001 0000 01PSTBNL21XXXX00001 940 00 :20:MPBZ :25:0003890413 :28C:000 :60F:C071205EUR2085,93 :61:071206C11,90NGT NONREF :86:0001239968 Hr X Colijn LANDGRAAF Hr X Colijn LANDGRAAF 1700.163221231474 TRANSACTIEDATUM: 06-12-2007 :61:071206D109,10NIC 004952732340412 :86:0002243510 KN: 004952739440412 049-8223343 BETREFT FACTUUR D.D. 28-11-2007 INCL. 17,42 BTW KPN Telefonie :61:071206D34,95NDV 4700134832333684 :86:0998234454 KN: 4702162821344484 4700124821134444 R.2003-13224 K.122368 PEDESCO/KLONSSEN.ORG :62F:C081119EUR289,33 :86:D000004C000009D9961,90C60315,92 -XXX ", #"\ [Tabular description begin] mt940 :messageheader1 mandatory ::exporttime \"0000\" drop ::CS1 \" \" drop ::exportday \"01\" drop ::exportaddress 12 ::exportnumber 5 \"[0-9]+\" :messageheader3 mandatory fold single ::messagetype \"940\" drop ::CS1 \" \" drop ::messagepriority \"00\" drop :TRN fold ::tag \":20:\" drop ::reference \"GTZPB|MPBZ|INGEB\" :accountid fold ::tag \":25:\" drop ::accountno 10 :statementno fold ::tag \":28C:\" drop ::settlementno 0 drop :openingbalance mandatory single ::tag \":60F:\" drop ::creditdebit 1 ::date 6 ::currency \"EUR\" ::amount 0 \"[0-9]+,[0-9][0-9]\" :statements ::statementline mandatory fold single :::tag \":61:\" drop :::valuedate 6 :::creditdebit 1 :::amount \"[0-9]+,[0-9][0-9]\" :::CS1 \"N\" drop :::transactiontype 3 # 3 for Postbank, 4 for ING :::paymentreference 0 ::informationtoaccountowner fold single :::tag \":86:\" drop :::description \"[^\\n]+(\\n[^:][^\\n]*)*\" :closingbalance mandatory single ::tag \":62[FM]:\" drop ::creditdebit 1 ::date 6 ::currency \"EUR\" ::amount 0 \"[0-9]+,[0-9][0-9]\" :informationtoaccountowner fold single ::tag \":86:\" drop ::debit \"D\" drop ::debitentries 6 ::credit \"C\" drop ::creditentries 6 ::debit \"D\" drop ::debitamount \"[0-9]+,[0-9][0-9]\" ::credit \"C\" drop ::creditamount \"[0-9]+,[0-9][0-9]\" drop ::accountname \"(\\n[^-:][^\\n]*)*\" drop :messagetrailer mandatory single ::start \"-\" ::end \"XXX\" [Tabular description end] ")->fetch()]], [[ ([ "mt940": ([ "accountno": "0003890413", "closingbalance": ([ "amount": "289,33", "creditdebit": "C", "currency": "EUR", "date": "081119"
5c02d42009-02-12Stephen R. van den Berg  ]),
2ad5d92009-02-28Martin Stjernholm  "creditentries": "000009", "debitamount": "9961,90", "debitentries": "000004", "messageheader1": ({ ([ "exportaddress": "PSTBNL21XXXX", "exportnumber": "00001" ]), ([ "exportaddress": "PSTBNL21XXXX", "exportnumber": "00001" ]) }), "messagetrailer": ([ "end": "XXX", "start": "-" ]), "openingbalance": ([ "amount": "2085,93", "creditdebit": "C", "currency": "EUR", "date": "071205" ]), "reference": "MPBZ", "statements": ({ ([ "amount": "11,90", "creditdebit": "C", "description": "0001239968 Hr X Colijn LANDGRAAF\n" "Hr X Colijn LANDGRAAF 1700.163221231474\n" "TRANSACTIEDATUM: 06-12-2007", "paymentreference": "NONREF", "transactiontype": "GT ", "valuedate": "071206" ]), ([ "amount": "109,10", "creditdebit": "D", "description": "0002243510 KN: 004952739440412\n" "049-8223343 BETREFT FACTUUR D.D. 28-11-2007\n" "INCL. 17,42 BTW KPN Telefonie", "paymentreference": "004952732340412", "transactiontype": "IC ", "valuedate": "071206" ]), ([ "amount": "34,95", "creditdebit": "D", "description": "0998234454 KN: 4702162821344484\n" "4700124821134444 R.2003-13224 K.122368\n" "PEDESCO/KLONSSEN.ORG", "paymentreference": "4700134832333684", "transactiontype": "DV ", "valuedate": "071206" ]) }) ])
5c02d42009-02-12Stephen R. van den Berg ])
2ad5d92009-02-28Martin Stjernholm ]])
5c02d42009-02-12Stephen R. van den Berg  END_MARKER