Files
swift-mirror/test/Syntax/tokens_nonbreaking_space.swift
Saleem Abdulrasool 93e610920f test: port Syntax test to Windows
Replace the inline sed commands with sed scripts to avoid the subshells
on Windows.  Additionally, the unicode handling on Windows causes
problems and using the scripts circumvents that problem.

Implement an inline dos2unix as the BSD sed does not support `-b` and on
Windows, sed will convert the line endings.
2019-01-15 15:37:55 -08:00

45 lines
1.5 KiB
Swift

// RUN: cat %s | sed -f %S/Inputs/nbsp.sed > %t.tmp
// RUN: cp -f %t.tmp %t
// RUN: %swift-syntax-test -input-source-filename %t -dump-full-tokens 2>&1 | %FileCheck %t
let a =Z3Z // nbsp(Z)
let bZ= 3Z
let cZ=Z3
// CHECK: 4:8: warning: non-breaking space (U+00A0) used instead of regular space
// CHECK: 4:11: warning: non-breaking space (U+00A0) used instead of regular space
// CHECK: 5:6: warning: non-breaking space (U+00A0) used instead of regular space
// CHECK: 5:11: warning: non-breaking space (U+00A0) used instead of regular space
// CHECK: 6:6: warning: non-breaking space (U+00A0) used instead of regular space
// CHECK: 6:9: warning: non-breaking space (U+00A0) used instead of regular space
// CHECK-LABEL: 4:7
// CHECK-NEXT:(Token equal
// CHECK-NEXT: (text="=")
// CHECK-NEXT: (trivia garbageText \302\240))
// CHECK-LABEL: 4:10
// CHECK-NEXT:(Token integer_literal
// CHECK-NEXT: (text="3")
// CHECK-NEXT: (trivia garbageText \302\240)
// CHECK-NEXT: (trivia space 1))
// CHECK-LABEL: 5:5
// CHECK-NEXT:(Token identifier
// CHECK-NEXT: (text="b")
// CHECK-NEXT: (trivia garbageText \302\240))
// CHECK-LABEL: 5:10
// CHECK-NEXT:(Token integer_literal
// CHECK-NEXT: (text="3")
// CHECK-NEXT: (trivia garbageText \302\240)
// CHECK-LABEL: 6:5
// CHECK-NEXT:(Token identifier
// CHECK-NEXT: (text="c")
// CHECK-NEXT: (trivia garbageText \302\240))
// CHECK-LABEL: 6:8
// CHECK-NEXT:(Token equal
// CHECK-NEXT: (text="=")
// CHECK-NEXT: (trivia garbageText \302\240))