I have been trying to set up a unit test which essentially tests whether what I read from a file elsewhere is properly parsed. I don't want to read the file in this unit test so I created an array with the information. But whatever I try the whitespace is transformed to '\t'.
let mgfSection =
[
"BEGIN IONS",
"PEPMASS=491.222686767578",
"CHARGE=2",
"TITLE=491.222686767578_1494.17_scan=6268_2014090922Mix2alkylISW10noEclu,seq={ATNYNAGDR},sup={4}",
"SCANS=0",
"491.2227\u00092",
"128.1677\t34.3",
"143.9659 14.8",
];
The above array when printed to the console directly yields '\t' in all locations where I would expect a tab character (5-7). However, it is literally '\t' and not the tab character so that I cannot split on it (mgfSection[6].split("\t") does not work). On the other hand, it would work when being read from a file so I cannot use ("\t") just to make my test work.
What can I do to have the whitespace show up as real whitespace for downstream functions?
Thank you, Jens
BTW, I am developing on AWS Cloud9.