Padding Incorrect for Non-String Values #1

Closed
david-hosier opened this Issue May 30, 2011 · 1 comment

Comments

Projects
None yet
2 participants

I am trying to adapt your put-object-rows.js example to use as a little demo, and I am having troubles with the padding on values other than Strings. Here is my script:

var cliff = require('cliff');

var objs = [];
objs.push({
    "bad": 3245628,
    "this_id_works": "3245628",
    "Count": 1,
    "AMO Class": "NetExpert",
    "Alert Name": "testAlert_521",
    "Severity": "Critical",
    "AMO Name": "DBtestMo-521"
});

cliff.putObjectRows('data', objs, ['this_id_works', 'AMO Class', 'AMO Name', 'Alert Name']);
cliff.putObjectRows('data', objs, ['bad', 'AMO Class', 'AMO Name', 'Alert Name']);

And here is the output:

$ node put-object-rows.js 
data:   this_id_works AMO Class AMO Name     Alert Name    
data:   3245628       NetExpert DBtestMo-521 testAlert_521 

data:   bad AMO Class AMO Name     Alert Name    
data:   3245628 NetExpert DBtestMo-521 testAlert_521 

With the "bad" value being a number instead of a String, you can see that the header does not get the correct padding, thus shifting the entire header row to the left. I can see some routine in the library that appears to be calculating padding, but I was not readily able to determine what the problem may be, or if the problem is even yours or is an issue with one of the dependencies.

indutny closed this in 82caff2 May 30, 2011

@indutny indutny added a commit that referenced this issue May 30, 2011

@indutny indutny [test] gh-1 regression test 36be4e2

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment