Files
swift-mirror/test/refactoring/LongNumber/basic.swift
Xi Ge 53585a5e70 Refactoring: Implement a refactoring action to simplify long number literal format. SR-5746
For instance, converting from "100000" to "100_000", and "1000.0001" to
"1_000.000_1".
2017-08-31 14:25:48 -07:00

17 lines
822 B
Swift

func foo() {
_ = 1234567
_ = 1234567.12345
_ = +1234567
_ = -1234567
}
// RUN: rm -rf %t.result && mkdir -p %t.result
// RUN: %refactor -simplify-long-number -source-filename %s -pos=2:9 > %t.result/Integer.swift
// RUN: diff -u %S/Outputs/Integer.expected %t.result/Integer.swift
// RUN: %refactor -simplify-long-number -source-filename %s -pos=3:9 > %t.result/Float.swift
// RUN: diff -u %S/Outputs/Float.expected %t.result/Float.swift
// RUN: %refactor -simplify-long-number -source-filename %s -pos=4:11 > %t.result/PositiveInteger.swift
// RUN: diff -u %S/Outputs/PositiveInteger.expected %t.result/PositiveInteger.swift
// RUN: %refactor -simplify-long-number -source-filename %s -pos=5:7 > %t.result/NegativeInteger.swift
// RUN: diff -u %S/Outputs/NegativeInteger.expected %t.result/NegativeInteger.swift