Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion +dj/+internal/Declare.m
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ case regexp(line, ['^[a-z][a-z\d_]*\s*' ... % name
end
end
% Escape characters: "/
field.comment = regexprep(field.comment, '(["\/])', '\\\\$1');
field.comment = regexprep(field.comment, '(["\/{}])', '\\\\$1');

category = dj.internal.Declare.matchType(field.type);
store = [];
Expand Down
2 changes: 1 addition & 1 deletion +dj/setup.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function setup(varargin)
struct(...
'Name', 'mym', ...
'ResolveTarget', 'datajoint/mym', ...
'Version', @(v) compareVersions(v, '2.8.0', @(v_actual,v_ref) v_actual>=v_ref)...
'Version', @(v) compareVersions(v, '2.8.2', @(v_actual,v_ref) v_actual>=v_ref)...
)...
};
try
Expand Down
2 changes: 1 addition & 1 deletion +dj/version.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function varargout = version
% report DataJoint version

v = struct('major',3,'minor',4,'bugfix',2);
v = struct('major',3,'minor',4,'bugfix',3);

if nargout
varargout{1}=v;
Expand Down
4 changes: 4 additions & 0 deletions docs-parts/intro/Releases_lang1.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
3.4.3 -- May 28, 2021
---------------------
* Bugfix: Add support to curly brackets in comments (#365) PR #373

3.4.2 -- March 16, 2021
--------------------------
* Bugfix: Fetchn with zero results throws an error (#353) PR #355
Expand Down
3 changes: 2 additions & 1 deletion tests/Main.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
classdef Main < ...
TestConfig & ...
TestConnection & ...
TestDeclaration & ...
TestERD & ...
TestExternalFile & ...
TestExternalS3 & ...
Expand All @@ -11,4 +12,4 @@
TestSchema & ...
TestTls & ...
TestUuid
end
end
31 changes: 31 additions & 0 deletions tests/TestDeclaration.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
classdef TestDeclaration < Prep
methods (Test)
%{ Function to test if a table can be inserted with curley brackets in the comments
%}
function TestDeclaration_testCurlyBracketComment(testCase)
packageName = 'Lab';
lowerPackageName = lower(packageName);
% Create the connection
c1 = dj.conn(...
testCase.CONN_INFO.host,...
testCase.CONN_INFO.user,...
testCase.CONN_INFO.password, '', true);

% Create the schema
dj.createSchema(packageName, [testCase.test_root '/test_schemas'], ...
[testCase.PREFIX '_' lowerPackageName]);

% Initialize the table
Lab.Subject

% Check that the comment is correct
table = Lab.Subject();
firstAttributeComment = table.header.attributes.comment;
assert(strcmp( ...
firstAttributeComment, ...
'{subject_id} Comment to test curly bracket'), ...
'Comment did not get inserted correctly'...
);
end
end
end
2 changes: 1 addition & 1 deletion tests/TestSchema.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function TestSchema_testUnsupportedDJTypes(testCase)
[testCase.PREFIX '_' lower(package)]);
schema = External.getSchema;
q = schema.v.Document & ['document_id=' num2str(id)];
% display
% display (be careful with MxPrint's b/c this test relies on stdout)
queryPreview = evalc('q');
queryPreview = splitlines(queryPreview);
recordPreview = queryPreview(end-4);
Expand Down
2 changes: 1 addition & 1 deletion tests/test_schemas/+Lab/Subject.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%{
# Subject
subject_id : int
subject_id : int # {subject_id} Comment to test curly bracket
---
subject_dob : date
unique index(subject_dob)
Expand Down