Skip to content

Commit 1330e44

Browse files
Fix merge conflicts.
2 parents bf41121 + 82183f1 commit 1330e44

File tree

7 files changed

+38
-5
lines changed

7 files changed

+38
-5
lines changed

+dj/+internal/Declare.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ case regexp(line, ['^[a-z][a-z\d_]*\s*' ... % name
382382
end
383383
end
384384
% Escape characters: "/
385-
field.comment = regexprep(field.comment, '(["\/])', '\\\\$1');
385+
field.comment = regexprep(field.comment, '(["\/{}])', '\\\\$1');
386386

387387
category = dj.internal.Declare.matchType(field.type);
388388
store = [];

+dj/setup.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function setup(varargin)
2323
struct(...
2424
'Name', 'mym', ...
2525
'ResolveTarget', 'datajoint/mym', ...
26-
'Version', @(v) compareVersions(v, '2.8.0', @(v_actual,v_ref) v_actual<=v_ref)...
26+
'Version', @(v) compareVersions(v, '2.8.2', @(v_actual,v_ref) v_actual>=v_ref)...
2727
)...
2828
};
2929
try

docs-parts/intro/Releases_lang1.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Bugfix: Regression error when using fetchn with a join (#361) PR #369
55
* Bugfix: Cascading delete not functioning properly when using renamed foreign keys (#362) PR #369
66
* Update NGINX reverse-proxy image use PR #369
7+
* Bugfix: Add support to curly brackets in comments (#365) PR #373
78

89
3.4.2 -- March 16, 2021
910
--------------------------

tests/Main.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
TestConfig & ...
33
TestConnection & ...
44
TestDelete & ...
5+
TestDeclaration & ...
56
TestERD & ...
67
TestExternalFile & ...
78
TestExternalS3 & ...
@@ -12,4 +13,4 @@
1213
TestSchema & ...
1314
TestTls & ...
1415
TestUuid
15-
end
16+
end

tests/TestDeclaration.m

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
classdef TestDeclaration < Prep
2+
methods (Test)
3+
%{ Function to test if a table can be inserted with curley brackets in the comments
4+
%}
5+
function TestDeclaration_testCurlyBracketComment(testCase)
6+
packageName = 'Lab';
7+
lowerPackageName = lower(packageName);
8+
% Create the connection
9+
c1 = dj.conn(...
10+
testCase.CONN_INFO.host,...
11+
testCase.CONN_INFO.user,...
12+
testCase.CONN_INFO.password, '', true);
13+
14+
% Create the schema
15+
dj.createSchema(packageName, [testCase.test_root '/test_schemas'], ...
16+
[testCase.PREFIX '_' lowerPackageName]);
17+
18+
% Initialize the table
19+
Lab.Subject
20+
21+
% Check that the comment is correct
22+
table = Lab.Subject();
23+
firstAttributeComment = table.header.attributes.comment;
24+
assert(strcmp( ...
25+
firstAttributeComment, ...
26+
'{subject_id} Comment to test curly bracket'), ...
27+
'Comment did not get inserted correctly'...
28+
);
29+
end
30+
end
31+
end

tests/TestSchema.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function TestSchema_testUnsupportedDJTypes(testCase)
3737
[testCase.PREFIX '_' lower(package)]);
3838
schema = External.getSchema;
3939
q = schema.v.Document & ['document_id=' num2str(id)];
40-
% display
40+
% display (be careful with MxPrint's b/c this test relies on stdout)
4141
queryPreview = evalc('q');
4242
queryPreview = splitlines(queryPreview);
4343
recordPreview = queryPreview(end-4);

tests/test_schemas/+Lab/Subject.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
%{
22
# Subject
3-
subject_id : int
3+
subject_id : int # {subject_id} Comment to test curly bracket
44
---
55
subject_dob : date
66
unique index(subject_dob)

0 commit comments

Comments
 (0)