Comments (7)
@rakaramos @ZevEisenberg
I've raised a PR to fix this issue here: #270
Please help to review it when you have time 🙏
from muter.
Hi @KyosukeKotani, and thanks for taking the time to write in! Would you be able to provide a sample project that reproduces the issue?
from muter.
@ZevEisenberg
Thank you for your reply.
I am unable to provide the code where the error occurred immediately as it is a product code.
I will try to reproduce this issue in a sample project.
Please wait a few days.
from muter.
@ZevEisenberg
Thank you for your patience.
We are unable to provide a sample project, but we have identified the cause of the error and provide a sample file.
Sample File
//
// sample_mutation.swift
// sample-project
//
import Foundation
public final class SampleError: NSObject, NSCoding {
public func encode(with coder: NSCoder) {
<#code#>
}
public init?(coder: NSCoder) {
<#code#>
}
public let text: String
public let viewCount: Int
public let activationFlag: Bool
public init?(dictionary: [String: Any]) {
guard
let text = dictionary["Text"] as? String,
let activationFlag = dictionary["ActivationFlag"] as? Bool,
let viewCount = dictionary["ViewCounts"] as? Int,
!text.isEmpty else {
return nil
}
self.text = text
self.viewCount = viewCount
self.activationFlag = activationFlag
}
public func isDiscarded() -> Bool {
if viewCount > 0 {
return true
}
return false
}
public func isEnabledToShow() -> Bool {
// バルーンの表示判定
return activationFlag && !isDiscarded()
}
}
Error Cause
// バルーンの表示判定
I have confirmed that deleting the above comment will prevent the error from occurring.
from muter.
Just to clarify - is the original comment in Japanese? If you replace the comment with English, does that fix the error? I'm wondering if this is a problem with how we are parsing multi-byte characters.
from muter.
Yes, it is. The original comment is in Japanese.
Replacing the Japanese with English fixes the error.
I too have a feeling that there is a problem with how we are parsing multi-byte characters.
from muter.
The problem lies at the line 74.
The nodePosition
here is UTF-8 offset, but later we treat it as character offset at line 77.
If we use alphabet character, utf-8 offset will equal to character offset since we only need 1 byte for alphabet character.
For non-alphabet character, it uses multi-byte => utf-8 offset is not equal to character offset => Crash
from muter.
Related Issues (20)
- Muter run throwing segmentaion fault HOT 11
- Mutation Schemata
- Migrate to versioned formulae (homebrew)
- Cannot write to file when run from Xcode 15 HOT 4
- Error: Could not parse buildRequest.json from build description path HOT 7
- Add Linux support HOT 2
- Use coverage to short-circuit mutation HOT 2
- Improve schemata testing HOT 2
- Reconsider defaultExcludeList values to be more specific HOT 3
- Muter discovered 0 mutants in 0 files or wrongfully fails tests when running on a new project with default config HOT 3
- RemoveSideEffectsOperator doesn't check for implicit return scenario HOT 4
- ApplySchemata step doesn't generate formatted code HOT 4
- Could not parse buildRequest.json from build description path HOT 1
- "error: invalid branch name: 'master'" when running on fresh swift package HOT 7
- Run mutations in parallel HOT 2
- Homebrew version of Muter very broken HOT 1
- Support xcodebuild as an executable for SPM projects HOT 2
- AcceptanceTests fail locally when using Sonoma 14.4.1 + Xcode 15.2 HOT 1
- Muter hangs when mutation change causes test hang HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from muter.