-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Реализована поддержка использования переноса строк
- Loading branch information
1 parent
aeb5a3b
commit 815dece
Showing
4 changed files
with
598,612 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
/* | ||
* This file is a part of Support Configuration. | ||
* | ||
* Copyright (c) 2019 - 2023 | ||
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
* | ||
* Support Configuration is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3.0 of the License, or (at your option) any later version. | ||
* | ||
* Support Configuration is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with Support Configuration. | ||
*/ | ||
package com.github._1c_syntax.bsl.supconf; | ||
/* | ||
* This file is a part of Support Configuration. | ||
* | ||
* Copyright (c) 2019 - 2023 | ||
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
* | ||
* Support Configuration is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3.0 of the License, or (at your option) any later version. | ||
* | ||
* Support Configuration is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with Support Configuration. | ||
*/ | ||
package com.github._1c_syntax.bsl.supconf; | ||
|
||
import com.github._1c_syntax.bsl.support.SupportVariant; | ||
import lombok.experimental.UtilityClass; | ||
|
@@ -46,7 +46,7 @@ | |
public class ParseSupportData { | ||
|
||
// взято из https://stackoverflow.com/questions/18144431/regex-to-split-a-csv | ||
private static final String REGEX = "(?:,|\\n|^)(\"(?:(?:\"\")*[^\"]*)*\"|[^\",\\n]*|(?:\\n|$))"; | ||
private static final String REGEX = "(?:,\\n?|\\n|^)(\"(?:(?:\"\")*[^\"]*)*\"|[^\",\\n]*|(?:\\n|$))"; | ||
private static final Pattern patternSplit = Pattern.compile(REGEX); | ||
|
||
private static final int POINT_COUNT_CONFIGURATION = 2; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
/* | ||
* This file is a part of Support Configuration. | ||
* | ||
* Copyright (c) 2019 - 2023 | ||
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
* | ||
* Support Configuration is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3.0 of the License, or (at your option) any later version. | ||
* | ||
* Support Configuration is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with Support Configuration. | ||
*/ | ||
package com.github._1c_syntax.supconf; | ||
/* | ||
* This file is a part of Support Configuration. | ||
* | ||
* Copyright (c) 2019 - 2023 | ||
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
* | ||
* Support Configuration is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3.0 of the License, or (at your option) any later version. | ||
* | ||
* Support Configuration is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with Support Configuration. | ||
*/ | ||
package com.github._1c_syntax.supconf; | ||
|
||
import com.github._1c_syntax.bsl.supconf.ParseSupportData; | ||
import com.github._1c_syntax.bsl.support.SupportVariant; | ||
|
@@ -79,6 +79,27 @@ void readSimpleCorrectSupport() { | |
; | ||
} | ||
|
||
@Test | ||
void readSimpleCorrectSupportClrf() { | ||
var path = Path.of("src/test/resources/correct_crlf/Ext/ParentConfigurations.bin"); | ||
var result = ParseSupportData.readSimple(path); | ||
|
||
assertThat(result) | ||
.hasSize(39784) | ||
.contains(MapEntry.entry("00035364-b591-4e6a-9219-e27dac18f687", SupportVariant.EDITABLE_SUPPORT_ENABLED)) | ||
; | ||
} | ||
|
||
@Test | ||
void readSimpleCorrectSupportClrf2() { | ||
var path = Path.of("src/test/resources/correct_crlf2/Ext/ParentConfigurations.bin"); | ||
var result = ParseSupportData.readSimple(path); | ||
|
||
assertThat(result) | ||
.hasSize(109840) | ||
.contains(MapEntry.entry("00009f6c-9712-4a66-a48a-50b59fc617b6", SupportVariant.NOT_EDITABLE)) | ||
; | ||
} | ||
@Test | ||
void readSimpleIncorrectSupport() { | ||
var path = Path.of("src/test/resources/incorrect/Ext/ParentConfigurations.bin"); | ||
|
Oops, something went wrong.