Character limit test text
To test a character limit you need text of an exact length: one under the limit, exactly at it and one over it. Here it is for the limits fields state most often, as counterstrings, which also show where a field cut the text.
How do I test a character limit?
With three lengths: one under the limit, exactly at it and one over it. That is boundary value testing applied to length, and the defect hides at the edge: a field that keeps 49 and 50 characters and quietly cuts 51 looks fine with any shorter text. The field must keep the first two whole. With the third it may refuse the text with a message, or stop typing at the limit where you can see it, but never keep a cut value without saying so.
What is a counterstring?
Text of numbers and stars, such as *3*5*7*10*, where each number is the place of the star after it. When a field cuts the text, the last number says where: a stored value ending in *48* means the field kept 48 characters. Every text below is a counterstring of exactly the length its label says.
10 characters
9 characters, within the limit
*3*5*7*9*
10 characters, within the limit
*3*5*7*10*
11 characters, one over the limit
2*4*6*8*11*
50 characters
49 characters, within the limit
*3*5*7*10*13*16*19*22*25*28*31*34*37*40*43*46*49*
50 characters, within the limit
2*4*6*8*11*14*17*20*23*26*29*32*35*38*41*44*47*50*
51 characters, one over the limit
*3*5*7*9*12*15*18*21*24*27*30*33*36*39*42*45*48*51*
100 characters
99 characters, within the limit
*3*5*7*9*12*15*18*21*24*27*30*33*36*39*42*45*48*51*54*57*60*63*66*69*72*75*78*81*84*87*90*93*96*99*
100 characters, within the limit
*3*5*7*9*12*15*18*21*24*27*30*33*36*39*42*45*48*51*54*57*60*63*66*69*72*75*78*81*84*87*90*93*96*100*
101 characters, one over the limit
*3*5*7*10*13*16*19*22*25*28*31*34*37*40*43*46*49*52*55*58*61*64*67*70*73*76*79*82*85*88*91*94*97*101*
255 characters
254 characters, within the limit
2*4*6*8*11*14*17*20*23*26*29*32*35*38*41*44*47*50*53*56*59*62*65*68*71*74*77*80*83*86*89*92*95*98*102*106*110*114*118*122*126*130*134*138*142*146*150*154*158*162*166*170*174*178*182*186*190*194*198*202*206*210*214*218*222*226*230*234*238*242*246*250*254*
255 characters, within the limit
*3*5*7*9*12*15*18*21*24*27*30*33*36*39*42*45*48*51*54*57*60*63*66*69*72*75*78*81*84*87*90*93*96*99*103*107*111*115*119*123*127*131*135*139*143*147*151*155*159*163*167*171*175*179*183*187*191*195*199*203*207*211*215*219*223*227*231*235*239*243*247*251*255*
256 characters, one over the limit
*3*5*7*9*12*15*18*21*24*27*30*33*36*39*42*45*48*51*54*57*60*63*66*69*72*75*78*81*84*87*90*93*96*100*104*108*112*116*120*124*128*132*136*140*144*148*152*156*160*164*168*172*176*180*184*188*192*196*200*204*208*212*216*220*224*228*232*236*240*244*248*252*256*
500 characters
499 characters, within the limit
*3*5*7*9*12*15*18*21*24*27*30*33*36*39*42*45*48*51*54*57*60*63*66*69*72*75*78*81*84*87*90*93*96*99*103*107*111*115*119*123*127*131*135*139*143*147*151*155*159*163*167*171*175*179*183*187*191*195*199*203*207*211*215*219*223*227*231*235*239*243*247*251*255*259*263*267*271*275*279*283*287*291*295*299*303*307*311*315*319*323*327*331*335*339*343*347*351*355*359*363*367*371*375*379*383*387*391*395*399*403*407*411*415*419*423*427*431*435*439*443*447*451*455*459*463*467*471*475*479*483*487*491*495*499*
500 characters, within the limit
*3*5*7*9*12*15*18*21*24*27*30*33*36*39*42*45*48*51*54*57*60*63*66*69*72*75*78*81*84*87*90*93*96*100*104*108*112*116*120*124*128*132*136*140*144*148*152*156*160*164*168*172*176*180*184*188*192*196*200*204*208*212*216*220*224*228*232*236*240*244*248*252*256*260*264*268*272*276*280*284*288*292*296*300*304*308*312*316*320*324*328*332*336*340*344*348*352*356*360*364*368*372*376*380*384*388*392*396*400*404*408*412*416*420*424*428*432*436*440*444*448*452*456*460*464*468*472*476*480*484*488*492*496*500*
501 characters, one over the limit
*3*5*7*10*13*16*19*22*25*28*31*34*37*40*43*46*49*52*55*58*61*64*67*70*73*76*79*82*85*88*91*94*97*101*105*109*113*117*121*125*129*133*137*141*145*149*153*157*161*165*169*173*177*181*185*189*193*197*201*205*209*213*217*221*225*229*233*237*241*245*249*253*257*261*265*269*273*277*281*285*289*293*297*301*305*309*313*317*321*325*329*333*337*341*345*349*353*357*361*365*369*373*377*381*385*389*393*397*401*405*409*413*417*421*425*429*433*437*441*445*449*453*457*461*465*469*473*477*481*485*489*493*497*501*
1000 characters
999 characters, within the limit
*3*5*7*9*12*15*18*21*24*27*30*33*36*39*42*45*48*51*54*57*60*63*66*69*72*75*78*81*84*87*90*93*96*99*103*107*111*115*119*123*127*131*135*139*143*147*151*155*159*163*167*171*175*179*183*187*191*195*199*203*207*211*215*219*223*227*231*235*239*243*247*251*255*259*263*267*271*275*279*283*287*291*295*299*303*307*311*315*319*323*327*331*335*339*343*347*351*355*359*363*367*371*375*379*383*387*391*395*399*403*407*411*415*419*423*427*431*435*439*443*447*451*455*459*463*467*471*475*479*483*487*491*495*499*503*507*511*515*519*523*527*531*535*539*543*547*551*555*559*563*567*571*575*579*583*587*591*595*599*603*607*611*615*619*623*627*631*635*639*643*647*651*655*659*663*667*671*675*679*683*687*691*695*699*703*707*711*715*719*723*727*731*735*739*743*747*751*755*759*763*767*771*775*779*783*787*791*795*799*803*807*811*815*819*823*827*831*835*839*843*847*851*855*859*863*867*871*875*879*883*887*891*895*899*903*907*911*915*919*923*927*931*935*939*943*947*951*955*959*963*967*971*975*979*983*987*991*995*999*
1000 characters, within the limit
*3*5*7*9*12*15*18*21*24*27*30*33*36*39*42*45*48*51*54*57*60*63*66*69*72*75*78*81*84*87*90*93*96*99*103*107*111*115*119*123*127*131*135*139*143*147*151*155*159*163*167*171*175*179*183*187*191*195*199*203*207*211*215*219*223*227*231*235*239*243*247*251*255*259*263*267*271*275*279*283*287*291*295*299*303*307*311*315*319*323*327*331*335*339*343*347*351*355*359*363*367*371*375*379*383*387*391*395*399*403*407*411*415*419*423*427*431*435*439*443*447*451*455*459*463*467*471*475*479*483*487*491*495*499*503*507*511*515*519*523*527*531*535*539*543*547*551*555*559*563*567*571*575*579*583*587*591*595*599*603*607*611*615*619*623*627*631*635*639*643*647*651*655*659*663*667*671*675*679*683*687*691*695*699*703*707*711*715*719*723*727*731*735*739*743*747*751*755*759*763*767*771*775*779*783*787*791*795*799*803*807*811*815*819*823*827*831*835*839*843*847*851*855*859*863*867*871*875*879*883*887*891*895*899*903*907*911*915*919*923*927*931*935*939*943*947*951*955*959*963*967*971*975*979*983*987*991*995*1000*
1001 characters, one over the limit
*3*5*7*9*12*15*18*21*24*27*30*33*36*39*42*45*48*51*54*57*60*63*66*69*72*75*78*81*84*87*90*93*96*100*104*108*112*116*120*124*128*132*136*140*144*148*152*156*160*164*168*172*176*180*184*188*192*196*200*204*208*212*216*220*224*228*232*236*240*244*248*252*256*260*264*268*272*276*280*284*288*292*296*300*304*308*312*316*320*324*328*332*336*340*344*348*352*356*360*364*368*372*376*380*384*388*392*396*400*404*408*412*416*420*424*428*432*436*440*444*448*452*456*460*464*468*472*476*480*484*488*492*496*500*504*508*512*516*520*524*528*532*536*540*544*548*552*556*560*564*568*572*576*580*584*588*592*596*600*604*608*612*616*620*624*628*632*636*640*644*648*652*656*660*664*668*672*676*680*684*688*692*696*700*704*708*712*716*720*724*728*732*736*740*744*748*752*756*760*764*768*772*776*780*784*788*792*796*800*804*808*812*816*820*824*828*832*836*840*844*848*852*856*860*864*868*872*876*880*884*888*892*896*900*904*908*912*916*920*924*928*932*936*940*944*948*952*956*960*964*968*972*976*980*984*988*992*996*1001*
Is 50 characters always 50?
No. “50 characters” is a different number to each part of an application. A browser’s maxlength counts UTF-16 units, so an emoji is two. A database column may count characters or bytes, and a letter outside ASCII is two bytes or more. A person counts what they can see. The same 50 characters, made of different letters:
| Fill | 50 characters of it | How long it is to a program |
|---|---|---|
| The letter a | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
|
| Counterstring | 2*4*6*8*11*14*17*20*23*26*29*32*35*38*41*44*47*50* |
|
| A letter of two bytes | łłłłłłłłłłłłłłłłłłłłłłłłłłłłłłłłłłłłłłłłłłłłłłłłłł |
|
| A sign of three bytes | €€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€ |
|
| An emoji of four bytes | 😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀 |
|
| A family emoji | 👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧👨👩👧 |
|
A field that keeps fifty letters a and cuts one of the others has told you what it really counts. nkb boundary explains which part of an application counts what.
How do I get text for any other limit?
In the palette, Length limit in the value window takes any limit, counted in characters, code points, UTF-16 units or bytes, and the shortcuts then type its values one by one, in letters, multi-byte characters, emoji and counterstrings. On the command line:
$ nkb boundary --max-length 72 --format lines
The texts on this page come from the same function, so they are exactly what the palette types. For the other values worth trying in a text field, see text box test cases.