test(language-service): delete expression-cases.ts (#36468)

This commit deletes `expression-cases.ts` and moves the test cases to
inline expressions in TEST_TEMPLATE.

PR Close #36468
This commit is contained in:
Keen Yee Liau
2020-04-06 16:14:09 -07:00
committed by Kara Erickson
parent 5fa7b8ba56
commit e145fa13b1
5 changed files with 26 additions and 70 deletions

View File

@ -1,41 +0,0 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Component} from '@angular/core';
export interface Person {
name: string;
age: number;
}
@Component({
template: '{{~{start-foo}foo~{end-foo}}}',
})
export class WrongFieldReference {
bar = 'bar';
}
@Component({
template: '{{~{start-nam}person.nam~{end-nam}}}',
})
export class WrongSubFieldReference {
person: Person = {name: 'Bob', age: 23};
}
@Component({
template: '{{~{start-myField}myField~{end-myField}}}',
})
export class PrivateReference {
private myField = 'My Field';
}
@Component({
template: '{{~{start-mod}"a" ~{end-mod}% 2}}',
})
export class ExpectNumericType {
}

View File

@ -9,9 +9,7 @@
import {CommonModule} from '@angular/common';
import {NgModule} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {AppComponent} from './app.component';
import * as ExpressionCases from './expression-cases';
import * as NgForCases from './ng-for-cases';
import * as NgIfCases from './ng-if-cases';
import * as ParsingCases from './parsing-cases';
@ -20,10 +18,6 @@ import * as ParsingCases from './parsing-cases';
imports: [CommonModule, FormsModule],
declarations: [
AppComponent,
ExpressionCases.ExpectNumericType,
ExpressionCases.PrivateReference,
ExpressionCases.WrongFieldReference,
ExpressionCases.WrongSubFieldReference,
NgForCases.UnknownEven,
NgForCases.UnknownPeople,
NgForCases.UnknownTrackBy,

View File

@ -169,6 +169,7 @@ export class TemplateReference {
birthday = new Date();
readonlyHeroes: ReadonlyArray<Readonly<Hero>> = this.heroes;
constNames = [{name: 'name'}] as const;
private myField = 'My Field';
}
@Component({