Permalink
Browse files

Unit test modified to relect changes that names are not automaticly c…

…onverted to camel_case
  • Loading branch information...
1 parent d45c173 commit bbb6092a063436390da955ed990b74913fedd615 Adam Magaluk committed Nov 19, 2012
Showing with 23 additions and 23 deletions.
  1. +23 −23 test/unittest.js
View
@@ -29,80 +29,80 @@ assert.throws(function() {
assert.strictEqual(T.parse(
T.serialize({
- optionalInt32: '3'
+ optional_int32: '3'
})
-).optionalInt32, 3, 'Number conversion');
+).optional_int32, 3, 'Number conversion');
assert.strictEqual(T.parse(
T.serialize({
- optionalInt32: ''
+ optional_int32: ''
})
-).optionalInt32, 0, 'Number conversion');
+).optional_int32, 0, 'Number conversion');
assert.strictEqual(T.parse(
T.serialize({
- optionalInt32: 'foo'
+ optional_int32: 'foo'
})
-).optionalInt32, 0, 'Number conversion');
+).optional_int32, 0, 'Number conversion');
assert.strictEqual(T.parse(
T.serialize({
- optionalInt32: {}
+ optional_int32: {}
})
-).optionalInt32, 0, 'Number conversion');
+).optional_int32, 0, 'Number conversion');
assert.strictEqual(T.parse(
T.serialize({
- optionalInt32: null
+ optional_int32: null
})
-).optionalInt32, undefined, 'null');
+).optional_int32, undefined, 'null');
assert.throws(function() {
T.serialize({
- optionalNestedEnum: 'foo'
+ optional_nested_enum: 'foo'
});
}, Error, 'Unknown enum');
assert.throws(function() {
T.serialize({
- optionalNestedMessage: 3
+ optional_nested_message: 3
});
}, Error, 'Not an object');
assert.throws(function() {
T.serialize({
- repeatedNestedMessage: ''
+ repeated_nested_message: ''
});
}, Error, 'Not an array');
assert.bufferEqual(T.parse(
T.serialize({
- optionalBytes: new Buffer('foo')
+ optional_bytes: new Buffer('foo')
})
-).optionalBytes, new Buffer('foo'));
+).optional_bytes, new Buffer('foo'));
assert.bufferEqual(T.parse(
T.serialize({
- optionalBytes: 'foo'
+ optional_bytes: 'foo'
})
-).optionalBytes, new Buffer('foo'));
+).optional_bytes, new Buffer('foo'));
assert.bufferEqual(T.parse(
T.serialize({
- optionalBytes: '\u20ac'
+ optional_bytes: '\u20ac'
})
-).optionalBytes, new Buffer('\u00e2\u0082\u00ac', 'binary'));
+).optional_bytes, new Buffer('\u00e2\u0082\u00ac', 'binary'));
assert.bufferEqual(T.parse(
T.serialize({
- optionalBytes: '\u0000'
+ optional_bytes: '\u0000'
})
-).optionalBytes, new Buffer('\u0000', 'binary'));
+).optional_bytes, new Buffer('\u0000', 'binary'));
assert.equal(T.parse(
T.serialize({
- optionalString: new Buffer('f\u0000o')
+ optional_string: new Buffer('f\u0000o')
})
-).optionalString, 'f\u0000o');
+).optional_string, 'f\u0000o');
puts('Success');

1 comment on commit bbb6092

Thanks for your work, but this will brake existing code. I think camelCasing needs to be part of a 'options framework' for protobuf, defaulting to true for camelCasing.

Please sign in to comment.